Changeset 54 for scripts/usr
- Timestamp:
- Jun 9, 2014, 2:26:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/commands/backup.sh
r53 r54 6 6 local DT=`date "+%Y-%m-%d_%H-%M"` 7 7 local NewBackup=$SDTD_BACKUP_ROOT/$DT 8 9 if [ ! -d "$SDTD_BASE/instances" ]; then 10 return 11 fi 8 12 9 13 # Check for backup folder existence … … 12 16 unset -v LatestBackup 13 17 local fileI 14 for fileI in "$SDTD_BACKUP_ROOT"/*; do15 if [ "$fileI" -nt "$LatestBackup" -a -d "$fileI"]; then18 for fileI in $(find "$SDTD_BACKUP_ROOT" -type d --mindepth 1 --maxdepth 1); do 19 if [ "$fileI" -nt "$LatestBackup" ]; then 16 20 LatestBackup=$fileI 17 21 fi 18 22 done 19 if [ -d $LatestBackup]; then20 cp -al $LatestBackup $NewBackup23 if [ -d "$LatestBackup" ]; then 24 cp -al "$LatestBackup" "$NewBackup" 21 25 fi 22 26 fi
Note:
See TracChangeset
for help on using the changeset viewer.