source: scripts/usr/local/bin/7dtd-backup.sh@ 4

Last change on this file since 4 was 1, checked in by alloc, 11 years ago

Initial commit

  • Property svn:executable set to *
File size: 580 bytes
RevLine 
[1]1#!/bin/bash
2. /etc/7dtd.conf
3
4DT=`date "+%Y-%m-%d_%H-%M"`
5NewBackup=$SDTD_BACKUP_ROOT/$DT
6
7# Check for backup folder existence
8if [ -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
15else
16 # Create new backup dir
17 mkdir $SDTD_BACKUP_ROOT
18fi
19
20$RSYNC -a --delete --numeric-ids --delete-excluded $SDTD_ROOT/Data/Worlds/./ $NewBackup
21touch $NewBackup
22
23#echo "Backup folder disk usage: `$DU -sh $SDTD_BACKUP_ROOT`"
Note: See TracBrowser for help on using the repository browser.