#!/bin/sh
CLIENT=client1
OBJECT=domain.nl
BASEDIR=/var/lib/psa/backupscript
BASEDIROBJECT=/var/lib/psa/dumps/.discovered/*_
DATADIR=/var/lib/psa/dumps/resellers/beheer/clientscd /$BASEDIR
file=”$BASEDIROBJECT$OBJECT”### bash check if file exists
if [ -f $file ];
### first backup the new stuff
then python s3cmd put -r $DATADIR/$CLIENT/domains/ s3://bucketname/”$CLIENT”_`date +%d%m%Y`/
rm -rf $BASEDIROBJECT$OBJECT
touch “$BASEDIR”/logs/”$CLIENT”_backup-transferred`date +_%d%m%Y`.txtelse echo “nothing to backup”
fi
echo “ready”
So, this is the modified backup script, where I have removed the delete part of the domain, I have created a logfile after ‘successful’ uploading the content, so that with this file you can delete finally the content on the server in another script.
script has not run in crontab yet and I have only adapted it for 1 domain yet. Comments are welcome.