diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-06-03 19:39:05 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-06-03 19:39:05 +0000 |
commit | 3249ce43ff343675a8bcfb150dd70128c9265f4d (patch) | |
tree | 958e3b5fd122668d9dd96fa73dbb3876c9165c13 | |
parent | ceb67522c8621b8a0fdf0de96739f01926b0ac57 (diff) |
Updates to linode scripts.
-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 {} \; |