Sync: How not delete files in destination if source is empty


#1

I want know if there’s a flag to tell rclone for not delete the files in destination if the source is empty.
I’m making a script who only will run in the server. That script will only sync the last 10 files in the server folder for Google Drive.
I’m thinking if someone, i don’t know why, delete my folder where the files are in the server. Using sync my backup in google drive will be deleted too, and i will lose everything.
I’ve see here in the forum that people already ask things similar to this, but not exactly the same thing and the flags they have used apparently doesn’t exist anymore.
There’s a flag for this case?


#2

Will the max-delete flag work for you?

Alternatively something like this in bash?

[[ -f $source ]] && rclone sync …

Additionallly, as a fail safe, you could undelete from Google trash assuming you’ve not disabled it.


#3

I can’t see this flag in --help. There’s a example in somewhere? When i use it, i get a error that the flag doesn’t exists.
I don’t considering using deactivated trash because i have a limited space in Google Drive. Only 15 G for now.

rclone sync source:$BACKUP_PATH dest:Backup:/backups --max-delete 5 --verbose --log-file $LOG_FILE --config “/home/anne/.config/rclone/rclone.conf”;

Erro: 2019/02/07 09:01:49 Fatal error: unknown flag: --max-delete


#4

Are you using an old version?

What does rclone version show?

   --max-delete int                             When synchronizing, limit the number of deletes (default -1)

#5

This is what rclone --version shows: rclone v1.36.
The flag --max-delete don’t appers in the --help too.
sudo apt-get upgrade rclone says the rclone is already in the newest version (1.36-3). I’m using Linux Mint 19 Tara.


#6

You have an exceptionally outdated version.

You can install the latest version here:

https://rclone.org/downloads/


#7

I’m fairly certain trashed objects do not count against quota but be warned they can go away earlier than 30 days if you exceed the 15GB.