Ubuntu – CronJob to copy a directory on a remote server

cronftpssh

I Need to create a Cronb that will run daily on my server and will ftp into a remote server with a username and password. It will copy a directory on that server and copy it onto a directory on my server. I then want the files to be deleted on the remote server.

Can someone help me with doing this?

Best Answer

Use following command to edit your cron job:

crontab -e

Then add following to the end of that:

0 0 * * * lftp -u username,password -e "your command;quit" ftp.site.com

Obviously you must install lftp package beforehand.

Related Question