CentOS Backup BASH Script

Posted by user1062058 on Server Fault See other posts from Server Fault or by user1062058
Published on 2011-11-26T00:26:25Z Indexed on 2011/11/26 1:53 UTC
Read the original article Hit count: 603

Filed under:
|
|

I just wrote this script for backing up everything into a tar.gz file. Does it look okay? How can I get the tar file to transfer itself over to another server after executing? FTP from itself? I'm going to put this script into a weekly cron.

#!/bin/bash

rm ~/backup.tar.gz #removes old backup
BACKUP_DIRS=$HOME #$HOME is builtin, it goes to /home/ and all child dirs
tar -cvzf backup.tar.gz $BACKUP_DIRS

# run tar -zxvf to extract backup.tar.gz

Thanks.

© Server Fault or respective owner

Related posts about linux

Related posts about centos