Traffic shaping during "office hours"

Hello,

I’m currently backing up my NAS to Backblaze and while Restic proving to be awesome on my desktop backup.
but, I’d like to limit the upload during “office” hours and then do whatever the ISP allows the rest of the time on the NAS

I’ve found https://linux.die.net/man/1/trickle that seems to do the job of limited upload/Downloads.

My questions are
if I kill the upload to then run a version of the script to backup with trickle, will Restic carry on from where it was stopped? ( I assume it would prune any half uploaded files and then carry on)

what’s the best way to script/cron job a stop of Restic’s current backup job before starting another?

many thanks

this is something I’ve never done before so I’m not even sure what to google :blush:

restic can limit its bandwidth via --limit-upload and --limit-download, but this is a single setting for the whole runtime of the process. Also, trickle won’t work because it uses LD_PRELOAD to insert itself between the program and the main library libc. Restic is written in Go, is statically linked and does not use libc, so there’s nothing trickle can do.

Yes, it’ll continue roughly where it left of. But that’s only for the backup operation: Other operations (especially prune) will restart from the beginning.

You can use flock from the moreutils package to only run a single process by maintaining a lock in the local file system.

1 Like

oh, awesome.

Thank you for such a speedy reply. sorry for the nooby questions
I don’t shell script often so I didn’t know about flock

Thank you again :smiley:

1 Like

Please don’t worry about that! We strive to be a welcoming community :slight_smile:

Could you please share the command line to backup your Nas. Also are u running it on windows or Linux

I was not able to backup my Nas from my windows system

I’m backing up from Linux
the script I’m using is
Debian paste error

You could use restic in combination with rclone, which allows for limiting bandwidth by a timetable. Quoting from the docs:

It is also possible to specify a “timetable” of limits, which will cause certain limits to be applied at certain times.

1 Like

you are a Legend!!!
rclone mixed with restic and a little https://wasabi.com and I’m a happy bunny!

now to script it all :smiley:

Oh, I didn’t know that rclone was able to do that, nice!