You are not logged in.

#1 2022-09-01 21:11:35

sweetthdevil
Member
Registered: 2009-10-20
Posts: 404

Starting bash script I'm background over shh

Hello all,

I have been looking at nohup and disown buy nothing work.

I have a bash script that mount a usb key and rsync a folder. But I want to be able to launch it over shh and let it run I'm the background and close the remote connection.

Thank you for reading and your assistance.

Offline

#2 2022-09-01 21:53:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,191
Website

Re: Starting bash script I'm background over shh

You can't use systemd-mount and a timer?

# edit: this sounds like an X-Y problem: what are you actually trying to achieve?

Last edited by jasonwryan (2022-09-01 21:54:45)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2022-09-01 23:31:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,272
Website

Re: Starting bash script I'm background over shh

Or if not a timer, just a regular service that you could "start" over ssh and then it runs supervised by systemd.

Alternatively, use tmux / screen and dettach the session.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2022-09-02 06:25:33

seth
Member
Registered: 2012-09-03
Posts: 31,898

Re: Starting bash script I'm background over shh

Also just looking at nohup and disown won't help - you gotta use them tongue
Assuming a service or timer won't cut it you need to elaborate on the actual problem - depending on the nature of the script/process you're trying to detach, it might not like that its stdin gets closed.

Offline

#5 2022-09-02 07:20:29

sweetthdevil
Member
Registered: 2009-10-20
Posts: 404

Re: Starting bash script I'm background over shh

Thank you, I haven't though of creating a systemd service.

Will get on to it!

Offline

Board footer

Powered by FluxBB