I have call recordings on AWS but I'm only given 10 GB of space so I would like to have a script which will SFTP to the Amazon AWS and only copy the newest files to my NAS sitting in the office. I can than use Windows Task Scheduler to run the scripts once a week.
The idea is that after all space on AWS is populated it starts to deleting the oldest recordings, so I want to prevent it and only use AWS as a buffer to store the current recordings and my NAS as a main storage. My script will be running every week/month to copy only the newest files in order to prevent loosing any recordings.
Below I have described the logic of how I would like the script to behavior:
Establish an SFTP session
if destination directory doesn't contain any files create a full backup first
if destination does contain some files copy only missing files
Looking forward for any ideas, thanks!