[Dxspider-support] Fast Restart when Updating from Crontrab

John Spigel w1an.dxusa at gmail.com
Thu Mar 9 00:30:46 GMT 2023


I offer the lines below to resolve the slow recovery for updates when 
done by crontab. Restart is less than 10 seconds for first partner 
connection.
A comment '#' is added to the shutdown crontab line and the '#' removed 
after 60 seconds to prevent a reshut during first minute.
Works on really old linux and the latest 22.04.1 GNU/Linux 5.15. Not 
known if you can do this in Windoze, but there is a perl sed version. 
Sed can never be the best solution, of course and it is non-forgiving.
Always make a backup of your crontab before experimenting.
Hope you have some fun with this and please report your experience. Good 
or bad. I hope the syntax is carried through OK via email.

73, John W1AN
dxc.dxusa.net 7373 (W1DX)

#Try one option at a time.
# ALWAYS!! Make a backup of crontab before playing with sed !!!
# Determine line number where you setup the command for Method 1.
Syntax is very important here!

50 * * * * run_cmd("shutdown")
# Method 1
# The below lines will comment and then remove the '#' after start 
completes.
# These below two lines act on the line number before the 's'
# 50 * * * * spawn("sed -i '4s/^/#&/' /spider/local_cmd/crontab")
# 51 * * * * spawn("sed -i '4s/#//g' /spider/local_cmd/crontab")

# Method 2
# These two lines act on the first line containing the shutd... command
50 * * * * spawn("sed -i '0,/shutdown/s/^/#&/' /spider/local_cmd/crontab")
51 * * * * spawn("sed -i '0,/shutdown/s/#//' /spider/local_cmd/crontab")





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20230309/7b4ed4f2/attachment.htm>


More information about the Dxspider-support mailing list