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