peterz
03-08-2007, 06:39 PM
Not sure if this is the right area but I have read through the threads talking about backup solutions. There are quite a few and all do different things so what is one more going to hurt. This little shell script does 2 simple things, 1 is it creates a full backup of all sites to a specified BACKUP_DIR and then deletes any that are more than N days old.
#!/bin/bash####################
BACKUP_DIR="/path/to/backup/dir"
DAYSOLD="7"
####################
#/home/interworx/bin/backup.pex --domains=all --file-path=$BACKUP_DIR
if [ -d $BACKUP_DIR]
then
find $BACKUP_DIR-maxdepth 0 -mtime +$DAYSOLD -exec rm {} \;
else
echo "$BACKUP_DIR does not exist or is not a directory."
fi
#!/bin/bash####################
BACKUP_DIR="/path/to/backup/dir"
DAYSOLD="7"
####################
#/home/interworx/bin/backup.pex --domains=all --file-path=$BACKUP_DIR
if [ -d $BACKUP_DIR]
then
find $BACKUP_DIR-maxdepth 0 -mtime +$DAYSOLD -exec rm {} \;
else
echo "$BACKUP_DIR does not exist or is not a directory."
fi