I have a NAS with a bunch of files I dont want to loose and a linux VPS with 250GB space off site.
The NAS runs an FTPS server. The VPS runs Debian/Linux
I want the VPS to copy/mirror all the contents from the FTPS to a local folder once per week. By this I mean:
On first run copy all files that are in a specified folder on the FTPS to a local folder (including sub folders)
On the second run add all new files that are either updated (different size or modified date)
Delete all local files on the VPS that are no longer available on the FTPS server.
Never touch the contents on the FTPS/NAS server
I'm sure there must be some script or program I can use to solve this. The ones I've found so far are either for windows or don't support FTPS.
You can use
lftp
(man lftp) client compiled with SSL support. It has amirror
command which mirrors specified source directory to local target directory. This command has additional options suchdelete files not present on remote site
which you need.A basic usage of this command can be: