Last change
on this file since 14 was 14, checked in by alloc, 11 years ago |
More instance validation, switch to XMLStarlet, config.xml instead of serverconfig.xml, admins.xml instead of serveradmin.xml
|
-
Property svn:executable
set to
*
|
File size:
590 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 | # Version 3
|
---|
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 |
|
---|
21 | $RSYNC -a --delete --numeric-ids --delete-excluded $SDTD_BASE/instances/./ $NewBackup
|
---|
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.