#!/bin/bash
#by roger and bkps for ftps
#join all folders for backup
tar cvf /tmp/bkp.tar /home /root
#compactar o tar
gzip /tmp/bkp.tar
#you remote server for this variable
serverip=192.168.0.1
serveruser=roger
#you user for ftp server
serverpass=xpto
#the ftp password for remote server
localdir=/tmp/
remotedir=/tmp/testeftp/
#for complete your configuratiom is recomendable configure im crontab
##### INSTALL COMPLETE #####
# DO NOT MODIFY ANYTHING BELOW #
bakdate=`date`
host=`hostname`
cd $localdir
echo "inicio do backup ftp em " $host $bakdate
#FTP the file to the backup directory on the backup server
/usr/bin/ftp -in <<EOF
open $serverip
user $serveruser $serverpass
cd $remotedir
bin
verbose
mput *.*
stat
bye
EOF
echo "Ftp backup completo em " $bakdate
rm /tmp/bkp.*
Nenhum comentário:
Postar um comentário