I would need a bash script to transfer folders recursively via FTP. Username/password/IP - static defined.
- Server where the script runs on: Linux
- Source server: Samba (Linux...)
- Dest. Server: Linux
As the files to be transferred are big database files (.bak, etc) overwriting should be avoided. Preferably no prompting because the script has to be 'cronned', to run at night.
(I'm not a hero in bash, but I have the impression it's the easiest for this situation)
Thanks a bunch in advance!
If the destination server is Linux might I suggest just using rsync with an ssh key? FTP is unencrypted and doesn't have native support for incremental backups.
A single rsync with a command line such as the below could suffice.
You can mount FTPfs and
cp
everything there. Make sure you disable delta-transfer so it doesn't download files from there :)BTW, how are you going to make these backups without overwriting? you'll have a bunch of old files mixed with some new ones if you don't use
date
in folder name.