You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new user just getting to know rclone may naturally explore the sync command. A typical such user will try out the arguments, using trial and error until they are just right.
For example, they may do this:
rclone sync to from
And of course that won't work. The order of the arguments is:
rclone sync from to
However, there is no second chance. The first command will have wiped out the "from" directory.
The deletion is permanent. There is no undo or trash can.
The deletion is recursive. If you are looking to sync from the root of your remote directory, everything is gone.
The deletion is massive. Thousands or tens of thousands of files can disappear.
The deletion includes git history, so no restore will be possible.
Suggested fix:
A prompt should ask the user to confirm they want to delete the target permanently
A -f flag should suppress the prompt
Consider an undo feature
Reacted by Ali Karbassi, ajthemacboy, Valeri Haralanov, Felix Spöttel and Chris B
Reacted by Valeri Haralanov, Agneev Mukherjee and Chris B
Let me also add a personal note. Your code is incredibly irresponsible. Are you actually not aware that extreme data destruction requires at least a trivial amount of caution?
In my own case, every source directory for multiple projects, including git history, disappeared. There is no Google Drive feature to get it back. Permanent deletion is the API call used in rclone. You might as well have arranged to smash the drive with a hammer.
Does rclone create any kind of log, at least? Is there a record of the remote URLs nuked?
Reacted by JoaoPSVieira
Reacted by matheod, piratetub, Rob Calistri, zerodayz1, pazevedo1979, Ivan Andreev, Harald Glatt and aparatext
To roll back deletions you have to be an enterprise customer. I started up a trial subscription. However the restore feature has not worked. It is possible that if I can get a URL to one of the deleted items it would help. That's why ask I ask about a log.
@ncw what are your thoughts on having --drive-use-trash as default for sync commands? Or using it as default for any rclone command that has the capability to delete files, e.g move, sync.
I think having a trash bin on google drive and not using it is such a shame - it's a great safety net that comes at no cost to the user, as storage is unlimited.
The reason for using drive trash is to be a safety net. Lots of cloud services are unlimited so this is not a problem. If people are limited, they could easily turn off trash.
If Trash is not unlimited, the user can either empty it or can set the flag to not use it. Either way this is not a big problem compared to accidental permanent deletion.
In addition to single --interactive flag introduce a multi-variant flag (a concrete name is TBD): --confirmation. Possible states:
off (false) or batch - destructive operations proceed automatically
on (true) or interactive - destructive operations require y/n on terminal, or abort if stdin is not a tty
auto - same as on if stdin is tty, off otherwise
Then we can:
make auto the default
make --interactive a shortcut for --confirmation on
introduce flag --batch or --force for use in rclone shell wrappers and pipelines (a shortcut for --confirmation off)
optionally: interactive mode will fallback to --dry-run instead of just aborting, if stdin is not a tty or when user answered no (or add a new confirmation variant for that)
multi-variance allows to add delete or dry-run-specific variants later, but I don't like it, it's complex and confusing IMO
optionally: when install.sh finds no existing rclone.conf, create a brand new one with profile section
[:default]
confirmations=on
Does this strike balance between batch and interactive usage?
Is forum or new issue a better place to discuss the idea?
What do you think?
Activity
lucasgonze commentedon Aug 2, 2017
Let me also add a personal note. Your code is incredibly irresponsible. Are you actually not aware that extreme data destruction requires at least a trivial amount of caution?
In my own case, every source directory for multiple projects, including git history, disappeared. There is no Google Drive feature to get it back. Permanent deletion is the API call used in rclone. You might as well have arranged to smash the drive with a hammer.
Does rclone create any kind of log, at least? Is there a record of the remote URLs nuked?
lucasgonze commentedon Aug 2, 2017
To roll back deletions you have to be an enterprise customer. I started up a trial subscription. However the restore feature has not worked. It is possible that if I can get a URL to one of the deleted items it would help. That's why ask I ask about a log.
ncw commentedon Aug 2, 2017
@lucasgonze I'm very sorry to hear about your problems with rclone.
The sync command is dangerous - note the bold important in the docs
rsyncwhichrcloneis modeled on has the same behavior andrsyncis the reason rclone works like it does.rclone has several features which can help here, one of which is
--backup-dirwhich stores any deleted files in a directory of your choice.There is also a
--drive-use-trashfeature which stores deleted items in the trash.I don't think either of those would have helped in your case though.
When you did
Was
toempty at that point? I could put in a test for that.if1mad commentedon Aug 2, 2017
@ncw what are your thoughts on having
--drive-use-trashas default for sync commands? Or using it as default for any rclone command that has the capability to delete files, e.g move, sync.I think having a trash bin on google drive and not using it is such a shame - it's a great safety net that comes at no cost to the user, as storage is unlimited.
if1mad commentedon Aug 2, 2017
The reason for using drive trash is to be a safety net. Lots of cloud services are unlimited so this is not a problem. If people are limited, they could easily turn off trash.
lucasgonze commentedon Aug 2, 2017
Compare the downside of not using drive trash to the downside of using it.
Downside of using it by default: user has to empty trash sooner than expected
Downside of not using by default: massive accidental irrevocable data loss for newbies
if1mad commentedon Aug 3, 2017
No. The trash is unlimited, just like your google drive.
There is literally no downside to using the trash as default that I can think of.
lucasgonze commentedon Aug 3, 2017
If Trash is not unlimited, the user can either empty it or can set the flag to not use it. Either way this is not a big problem compared to accidental permanent deletion.
19 remaining items
docs: promote the use of -i/--interactive and "rclone sync -i" everyw…
ncw commentedon Jun 10, 2020
I've merged the
-iPR which I think is a good first step...docs: promote the use of -i/--interactive and "rclone sync -i" everyw…
ivandeex commentedon Nov 15, 2020
This
willcan be partially mitigated by config profiles (#2697).See #1574 (comment)
ivandeex commentedon Dec 23, 2020
@ncw
Request for comments:
In addition to single
--interactiveflag introduce a multi-variant flag (a concrete name is TBD):--confirmation. Possible states:off(false) orbatch- destructive operations proceed automaticallyon(true) orinteractive- destructive operations requirey/non terminal, or abort if stdin is not a ttyauto- same asonif stdin is tty,offotherwiseThen we can:
autothe default--interactivea shortcut for--confirmation on--batchor--forcefor use in rclone shell wrappers and pipelines (a shortcut for--confirmation off)--dry-runinstead of just aborting, if stdin is not a tty or when user answeredno(or add a new confirmation variant for that)Does this strike balance between batch and interactive usage?
Is forum or new issue a better place to discuss the idea?
What do you think?
mrsilva commentedon Jan 5, 2021
I can't understand some of the unfortunate comments above, rclone is well documented and it will do what you tell it to do.
Having said that I do believe rclone could be improved with a 'delete all' protection flag. Something like:
--delete-protection
Which when used together with the sync command would only protect destination files from total destruction:
IF source root folder doesn't exist OR is empty, DON'T touch destination files
Thanks
ivandeex commentedon Nov 19, 2021
Closed after 1 year of total inactivity.
docs: promote the use of -i/--interactive and "rclone sync -i" everyw…