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
I run my backup to Backblaze B2. To backup my entire system to B2 takes several days to finish. I don't want to run my laptop until Rclone is finished.
Thus, at one point I will want to terminate the Rclone process to continue at a later stage.
However, if I terminate in the middle of a large file upload, next time Rclone will start with this file from scratch.
I would need a way to automatically terminate after the last (large) file has finished uploading to avoid having to start with unfinished files next time I run Rclone.
Reacted by Alfonso Montero López, Roman Donchenko, Adrian, Paul, AbsurdlySuspicious and Allyn Malventano
One way to help with this (especially if you have limited bandwidth) is to limit the simultaneous transfers. I run --transfers=1 at home so that it will finish individual files as quickly as possible and limit this problem to at most a single large file. However, if you have a lot of bandwidth at your disposal then this will typically rate limit you on the cloud end. Just a thought.
Graceful shutdown would be very interesting, with a few caveats:
The user should get an immediate printout/estimate of the remaining time, so judge whether they want to wait for completion. If I need to grab my laptop and leave, I might be willing to wait a minute or two, but not an hour.
A non-graceful shutdown should be offered, so if the user needs to leave now (or there are other forceful needs - OS reboot, emergency sleep due to loss of power, etc) that should be possible as it is today. Sometimes you just can't do things nicely. ;)
Reacted by Robert Orzanna, Alfonso Montero López and Scott Edlund
I've seen programs which do the graceful shutdown on the first CTRL-C and quit permanently on the second.
Another option would be to implement this with a different signal - that would stop it working on Windows.
This behavior could or maybe should be controlled by a flag, say --graceful-stop or something like that.
Thoughts?
Reacted by Robert Orzanna, Stefan Breunig, seuffert, Diego Spinola, Donald Webster, David le Blanc, Mike Wright, Robert Wlodarczyk, Alfonso Montero López and Adrian
was about to file an issue for this. I think it should be part of the remote control interface.
rclone rc gracefull-shutdown, doesn't queue anything for the future.
if one wants to add it via other signals that can come later, but this seems like it should be part of the remote control interface first, as that's the easiest to get right
was about to file an issue for this. I think it should be part of the remote control interface.
rclone rc gracefull-shutdown, doesn't queue anything for the future.
if one wants to add it via other signals that can come later, but this seems like it should be part of the remote control interface first, as that's the easiest to get right
That sounds like a good idea - thanks. I'l re-working some of that infrastructure at the moment so I'll see if I can fit it in there.
I wanted to chime in to add that this feature would be extremely helpful.
The rc idea sounds promising. Another idea might be to let the user put a specially named file in a directory, and this signals to rclone to stop processing that directory. However, from looking at the code (my first time looking at Go, so please forgive me!) it looks like the upload list is compiled before any uploads start, so this wouldn't work.
(as an aside, the idea of having a directory ignored by including a special file in it would be a very convenient way of specifying excludes for many use cases...I don't see that this is possible now)
A graceful stop rc feature is a lot easier to implement than a file in a directory alas. It wouldn't be too difficult to implement provided you don't mind sticking your fingers into concurrent flying chainsaws that is rclone's sync code ;-)
@pesaventofilippo what rclone version did you try that with? If not the latest, can you retry with v1.62.2? There have been bugs with rclone hanging on reaching this limit in old versions but I think (hope!) they are fixed in the latest version.
Activity
diamondsw commentedon Jul 11, 2017
One way to help with this (especially if you have limited bandwidth) is to limit the simultaneous transfers. I run --transfers=1 at home so that it will finish individual files as quickly as possible and limit this problem to at most a single large file. However, if you have a lot of bandwidth at your disposal then this will typically rate limit you on the cloud end. Just a thought.
orschiro commentedon Jul 12, 2017
@diamondsw thanks for the idea. Will give it a try. Any other thoughts?
ncw commentedon Jul 13, 2017
I think there is an issue about doing a graceful shutdown for rclone (can't find it at the moment!)
This would cause rclone to finish transferring the files it was transferring before it exited.
Does that sound useful?
orschiro commentedon Jul 13, 2017
And this would work with large files, too?
diamondsw commentedon Jul 17, 2017
Graceful shutdown would be very interesting, with a few caveats:
ncw commentedon Jul 30, 2017
I've seen programs which do the graceful shutdown on the first CTRL-C and quit permanently on the second.
Another option would be to implement this with a different signal - that would stop it working on Windows.
This behavior could or maybe should be controlled by a flag, say
--graceful-stopor something like that.Thoughts?
orschiro commentedon Jul 30, 2017
Nice, like this idea!
You have my vote. :-)
Tr4il commentedon Oct 1, 2019
Was there ever any news/updates to this? It's something I'd actually use a lot! :)
kageurufu commentedon Jan 9, 2020
I'd like to see this implemented using posix signals, maybe SIGTERM (requesting termination) or SIGHUP (hangup) could be semantically sane.
Then adding a --graceful-stop as @ncw suggested could attach that to SIGINT (Ctrl+C sends this) as well.
Maybe do a graceful shutdown, then abort for subsequent SIGINTs? (EDIT: Just saw this was already suggested)
Then, I could safely
killall --SIGTERM rclonefrom a script to safely stop current background transfers during system shutdown or somethingsjpotter commentedon Jan 20, 2020
was about to file an issue for this. I think it should be part of the remote control interface.
rclone rc gracefull-shutdown, doesn't queue anything for the future.
if one wants to add it via other signals that can come later, but this seems like it should be part of the remote control interface first, as that's the easiest to get right
ncw commentedon Jan 22, 2020
That sounds like a good idea - thanks. I'l re-working some of that infrastructure at the moment so I'll see if I can fit it in there.
scottmlew commentedon Apr 6, 2020
I wanted to chime in to add that this feature would be extremely helpful.
The rc idea sounds promising. Another idea might be to let the user put a specially named file in a directory, and this signals to rclone to stop processing that directory. However, from looking at the code (my first time looking at Go, so please forgive me!) it looks like the upload list is compiled before any uploads start, so this wouldn't work.
(as an aside, the idea of having a directory ignored by including a special file in it would be a very convenient way of specifying excludes for many use cases...I don't see that this is possible now)
ncw commentedon Apr 10, 2020
A
graceful stoprc feature is a lot easier to implement than a file in a directory alas. It wouldn't be too difficult to implement provided you don't mind sticking your fingers into concurrent flying chainsaws that is rclone's sync code ;-)pesaventofilippo commentedon May 30, 2023
Any news on this? AFAIK it's still not implemented
ncw commentedon May 30, 2023
I think if you were to use the
rcto set this flag to something smallThen rclone would stop after finishing its current transfers.
So first you'd want to set a graceful cutoff
Then set the cutoff to something small and rclone will stop after the current transfers are done.
@pesaventofilippo - do you want to give that a try?
pesaventofilippo commentedon Jun 1, 2023
I tried it - it kinda worked.
It stopped uploading after the current transfer was finished, throwing an error (as expected, it reached the limit).
Instead of quitting when finished, it just hanged indefinitely doing nothing, but all current transfers were done so I just stopped it with ctrl-c.
(still, in the future it would be nice to have an option to "formally" stop after current transfers and gracefully exit without throwing an error)
ncw commentedon Jun 1, 2023
@pesaventofilippo what rclone version did you try that with? If not the latest, can you retry with v1.62.2? There have been bugs with rclone hanging on reaching this limit in old versions but I think (hope!) they are fixed in the latest version.
pesaventofilippo commentedon Jun 1, 2023
Yep, I tried with the latest version v1.62.2
Maybe I'll do more tests when I have the occasion to see if it happens every time
ncw commentedon Jun 1, 2023
@pesaventofilippo if you can get a log with -vv of it hanging then please open a new issue on Github about it as it isn't supposed to hang! Thanks
malventano commentedon Mar 17, 2026
Closed as 'not planned' but has been asked about since 2017, with longstanding interest by @ncw ?