Script bash pentru back-up fisiere pe ftp

Configurare noua (How To)

Situatie

Solutie

Pasi de urmat

pico ftp.sh

introducem scriptul

#!/bin/sh
HOST=’ip server ftp’
USER=’utilizator ftp’
PASSWD=’parola ftp’
FILE=’locatia fisierelor ex: /home/*.*’

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
prompt
mput $FILE
quit
END_SCRIPT
exit 0

salvam

rulam comanda chmod+x ftp.sh

crontab -e 00 21 * * * /locatia/catre/ftp.sh
Acest script va rula in ficare zi la ora 21

Tip solutie

Permanent

Voteaza

(13 din 28 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?