diff options
-rwxr-xr-x | linode/backup.sh | 2 | ||||
-rwxr-xr-x | linode/cpbackup.sh | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/linode/backup.sh b/linode/backup.sh index 3a5e2e1..00ff1b2 100755 --- a/linode/backup.sh +++ b/linode/backup.sh @@ -8,7 +8,7 @@ PKGS=tmp/pkglist-$$ SOURCE="home/ianc etc usr/local/etc usr/local/svn usr/local/svn-private $SQL $PKGS" -BACKUP=$DEST/$(date +%Y%m%d-%H%S).tar.gz +BACKUP=$DEST/$(date +%Y%m%d).tar.gz echo Dumping database mysqldump -u root --password=$(cat /usr/local/etc/mysqlpassword) --all-databases > $SQL diff --git a/linode/cpbackup.sh b/linode/cpbackup.sh new file mode 100755 index 0000000..2cfbdef --- /dev/null +++ b/linode/cpbackup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +BACKUP=/data/backup/$(date +%Y%m%d).tar.gz + +echo Fetching $BACKUP + +scp -pq -P 2222 "usertk421@noddybox.co.uk:/$BACKUP" $HOME/backup + +echo Removing old backups +cd $HOME/backup +find . -mtime +10 -print -exec rm {} \; |