Quote:
Originally Posted by zhjim
You would need to kill all childs of your script. Check out this one http://stackoverflow.com/questions/3...hild-processes
PID+1 could work but can cause some real bad things if in the moment from calling lftp from your script another process gets started. You could also try to run lftp in the background using lftp &. The ampersand puts the process into background. Then with echo $! /runt/lftp.pid save the pid of the last process run in background. Just go with the solution in the link above.
|
Yesss! Thanks a million Zhjim this is the last piece of the puzzle:
pkill -TERM -P $(cat ~/[path to my backup.pid file] so does
pkill -TERM $(cat ~/[path to my backup.pid file]
Before I go to bed I just shut down openelec on the pi with the remote and leave it to it:
1. auto reboot into Raspian;
2. 11.59 run crontab download script;
3. 05.55 run crontab failsafe kill download script;
4. 06.00 run crontab reboot pi script;
5. @ reboot crontab script creates an autoboot.txt file to make the pi reboot into openelec partition;
6. as openelec starts up - autostart.sh file deletes the autoboot.txt file created;
7. 6.20 little people appear
8. normal operation resumes!
Thanks for all your help. Charles