Restic in the backround?

Hi,
I was wondering if restic could run in the background? lets say i run the command

restic -r /media/nas/backupsdaily backup /media/zeus/shares

but if i disconnect the session from putty it stops, would it be possible to run even if i disconnect the session on putty?

Thank you

Why don’t you use a script with a cron job? That way you shouldn’t worry about running Restic manually. Here’s an example of a script and it says how to setup a cron job. I don’t know what operating system you’re using and as far as I know this script is for GNU/Linux but you could get the idea. https://gitlab.com/sulfuror/rescript.sh

Thanks for the reply, im using somewhat the same script but what happens sometimes the NAS is off and i need to turn it on so it fails the restic backup. So i would need to run it manually just for that day

You could just suffix the command with & and have it run in the background… and prefix with nohup to have it ignore the HUP signal.

1 Like

@killmasta93 two options:

  1. Run in the background, will keep running if you disconnect. Output will be in nohup.out.
nohup restic -r /media/nas/backupsdaily backup /media/zeus/shares &
  1. Start screen, run the command, then detach (or if detached by disconnection).
screen
restic -r /media/nas/backupsdaily backup /media/zeus/shares
C-a C-d

When you reconnect used screen -r to reattach to the screen session.

I second the vote of use screen. If you are going to do things on the command line of remote computers then screen (or tmux) is super useful to learn. And screen is included by default in lots of places.

The big advantage, in this case, is that if you get disconnected then your shells continue running and you can reattach to them in the future.

Lots of ways, an additional one would be to use tmux if you are familiar with it.

Thanks guys that was it the noup and the & did the trick thank you again