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

Last change on this file since 16 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
RevLine 
[1]1#!/bin/bash
[14]2# Version 3
[1]3. /etc/7dtd.conf
4
5DT=`date "+%Y-%m-%d_%H-%M"`
6NewBackup=$SDTD_BACKUP_ROOT/$DT
7
8# Check for backup folder existence
9if [ -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
16else
17 # Create new backup dir
18 mkdir $SDTD_BACKUP_ROOT
19fi
20
[9]21$RSYNC -a --delete --numeric-ids --delete-excluded $SDTD_BASE/instances/./ $NewBackup
[1]22touch $NewBackup
23
24#echo "Backup folder disk usage: `$DU -sh $SDTD_BACKUP_ROOT`"
Note: See TracBrowser for help on using the repository browser.