guide in stile txt e appunti incomprensibili...

martedì 2 novembre 2010

backup dati in FTP linux

script linux per backup dati via ftp su server esterno:


#!/bin/bash
# ftp.sh

REMOTE='ipremoto'
USER='user'
PASSWORD='password'
FTPLOG='/root/pxmonitor/logs/ftplog.txt'
date >> $FTPLOG

#######################################################################
#
# FTP connection and mget of files
#
#######################################################################

cd /root/pxmonitor/localfiles
ls -alh > preftp.txt
ftp -i -n -v $REMOTE <<_FTP>>$FTPLOG
quote USER $USER
quote PASS $PASSWORD
binary
cd transportstream
mget *.ts
close
bye

open -u 'userftp','passwordftp' -p 21 ipserverftp
mirror -c -e -R /var/www/vhosts/directorydabackuppare
exit

schedulare con cron.d questo script.

Nessun commento:

Posta un commento