cancel
Showing results for 
Search instead for 
Did you mean: 

how do you stop a running script?

manatee
Level 6

NBU 7.6.3

i have this script that i've been troubleshooting for taking so long to finish the backup. this script also includes a monthly backup. so it happened that due to the sluggish performance, the daily script overlapped the monthly script affecting the monthly script (monthly didn't run).

in cases similar to this, how do you tell the script to stop running after X number of hours has passed OR if another script will start (for the same machine) and overlap with it?

2 REPLIES 2

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

not really a NetBackup question but you'll need to build intelligence into the script. At execution your scripts could check for the existence of another active script by either doing a ps and looking for the script name, or you could have the scripts create "lock files" that indicate that they're running (the lock files need to be removed at completion). If another script is found to be running you can then decide to either not run, or run the one that is more important.

 

 

Nicolai
Moderator
Moderator
Partner    VIP   

You can use the Linux "timeout" command to cancel a script after X number of second/minutes/hours/days.

Depending on Linux release it can be either a script or command

https://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.html