Last change
on this file since 11 was 10, checked in by alloc, 11 years ago |
Version 1
|
-
Property svn:executable
set to
*
|
File size:
590 bytes
|
Rev | Line | |
---|
[1] | 1 | #!/bin/bash
|
---|
[10] | 2 | # Version 1
|
---|
[1] | 3 | . /etc/7dtd.conf
|
---|
| 4 |
|
---|
| 5 | DT=`date "+%Y-%m-%d_%H-%M"`
|
---|
| 6 | NewBackup=$SDTD_BACKUP_ROOT/$DT
|
---|
| 7 |
|
---|
| 8 | # Check for backup folder existence
|
---|
| 9 | if [ -e $SDTD_BACKUP_ROOT ]; then
|
---|
| 10 | # Exists, copy(link) latest backup
|
---|
| 11 | unset -v LatestBackup
|
---|
| 12 | for file in "$SDTD_BACKUP_ROOT"/*; do
|
---|
| 13 | [[ $file -nt $LatestBackup ]] && LatestBackup=$file
|
---|
| 14 | done
|
---|
| 15 | $CP -al $LatestBackup $NewBackup
|
---|
| 16 | else
|
---|
| 17 | # Create new backup dir
|
---|
| 18 | mkdir $SDTD_BACKUP_ROOT
|
---|
| 19 | fi
|
---|
| 20 |
|
---|
[9] | 21 | $RSYNC -a --delete --numeric-ids --delete-excluded $SDTD_BASE/instances/./ $NewBackup
|
---|
[1] | 22 | touch $NewBackup
|
---|
| 23 |
|
---|
| 24 | #echo "Backup folder disk usage: `$DU -sh $SDTD_BACKUP_ROOT`"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.