davezeking
Verified User
- Joined
- Jan 4, 2007
- Messages
- 16
Backup Script
I have been meaning to post an update here for some time, I have also developed a small script that defaltes the GZIP archive leaving only the TAR archive, I then RSYNC these files and this is currently working well except for one particular TAR file (which is > 4GB) that fails every night.
The first backup is quite large due the uncompresed files but with subsequent backups only the differences are sent. I also investigated the -rsyncable option but this never seemed to work well and I didn't like adding the extra load of rezipping on the server after each backup.
My script is as follows:
The script is installed as follows:
If you don't mind the larger filesize try this out and let me know how it goes.
I have been meaning to post an update here for some time, I have also developed a small script that defaltes the GZIP archive leaving only the TAR archive, I then RSYNC these files and this is currently working well except for one particular TAR file (which is > 4GB) that fails every night.
The first backup is quite large due the uncompresed files but with subsequent backups only the differences are sent. I also investigated the -rsyncable option but this never seemed to work well and I didn't like adding the extra load of rezipping on the server after each backup.
My script is as follows:
Code:
#!/bin/bash
RSYNC_BACKUPS_PATH=/home/admin/admin_backups/local_rsync_backup
# Check the $file variable is set
if [[ -n "{$file}" ]] ; then
# Only manipulate files that are in our RSYNC_BACKUPS_PATH
# otherwise we may break other backups (e.g. FTP backup)
if grep -q $RSYNC_BACKUPS_PATH <<<$file; then
# Check the $file exists
if [[ -e $file ]] ; then
gunzip -f $file
fi
fi
fi
The script is installed as follows:
Code:
nano /usr/local/directadmin/scripts/custom/user_backup_post.sh
chown diradmin:diradmin /usr/local/directadmin/scripts/custom/user_backup_post.sh
chmod 755 /usr/local/directadmin/scripts/custom/user_backup_post.sh
If you don't mind the larger filesize try this out and let me know how it goes.