Command to delete from remote if exists local

Hi. what the best line of code to use to delete file(s) from remote after it has copied to local from a google drive, ensuring first a 1 to 1 match (rclone check?). There may be 1 or multiple files in the remote drive.

Presently my copy command looks like this:

rclone copy safebox:sync /mnt/user/downloads/incomplete/
–transfers=100 --checkers=100 --min-age 15m --log-file=$LOGFILE

You probably want to use rclone move for this, which will ensure the MD5SUM of the file matches before deleting the remote copy.

1 Like

i’ll try that @ncw. Thanks! also, are the other commands ok, e.g. transfers and checkers?

Yes. sync copy and move all run on the same engine just with a few tweaks.