#!/bin/bash
ftp_site=ftp://yoursite.com
username=roger
passwd=abc123
backupdir=$HOME
filename="backup-$(date '+%F-%H%M').tar.gz"
echo "Creating a backup file $filename of $backupdir."
# Make a tar gzipped backup file
tar -cvzf "$filename" "$backupdir"
ftp -in <<EOF
open $ftp_site
user $username $passwd
bin
put $filename
close
bye
EOF
This entry was posted on June 28, 2012, 8:04 pm and is filed under centos, Linux Trick. You can follow any responses to this entry through RSS 2.0.
You can skip to the end and leave a response. Pinging is currently not allowed.