Download sync script

How can I make a script that once a day will upload a file via ftp to several different servers and then write (in the log) how long it takes to download?

Thanks to Rajax, I have cronjob installed to execute this with a script, suppose it is called ftpScript.sh:

#!/bin/sh

HOST='ftp.users.qwest.net'
USER='MYUSERNAME'
PASSWD='MYPASSWORD'
FILE='filename.gif'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE

quit
END_SCRIPT
exit 0

Where can I place this part?

time -a output.log ftpScript.sh
+1
source share
1 answer

You can use cron to execute the script once a day.

Use ftp command line file to download files and time command in time, how much time has passed.

Adding time output to the log:

time -a output.log ftpScript.sh
+1
source

Source: https://habr.com/ru/post/1718958/


All Articles