Sync only if there is a certain file in the folder?

Hi

I am using the sync command for cloning my files to the other side (local to sftp) It works great and I like it a lot, more than Rsync.

Is it possible to run sync for real only if there is acertain file in the source folder? The reason is that I want to put this in a cron job and I want to make sure that I am not wiping out the target. These are mounted bacups so they always have backup conf files there.

thanks

hello and welcome to the forum,

it should be easy to write a batch script that looks for a file on the local file system and if the file exists, then run rclone

on windows

if exist c:\test\file.txt goto yesfile
goto end
:yesfile
rclone sync c:\test sftp:
:end
1 Like

Thanks I will see how I can do that with Bash.

ls /path/file && rclone command....
2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.