I have two questions about scripts:
1) How can I write a shutdown script for a script that runs automatically. For instance, I have a script that runs backups as soon as the computer boots, and then shuts down the computer when it is done. Periodically, I want the computer to stay up. I think the easiest way to do this would be to make the script check for the existance of a lock file before it shuts down, and if it exists, it just exits without shutting down. Can anyone give me a brief example of how to accomplish this?
2) Secondly, I have my backup script written, but it only works when I run it manually. When it is run on bootup, the commands where it logs into the other servers to run a job works, but the rsync command does not run. I'm not sure why this is? Like I said, everything works fine when I run it manually. Any ideas?
Thanks.
1) How can I write a shutdown script for a script that runs automatically. For instance, I have a script that runs backups as soon as the computer boots, and then shuts down the computer when it is done. Periodically, I want the computer to stay up. I think the easiest way to do this would be to make the script check for the existance of a lock file before it shuts down, and if it exists, it just exits without shutting down. Can anyone give me a brief example of how to accomplish this?
2) Secondly, I have my backup script written, but it only works when I run it manually. When it is run on bootup, the commands where it logs into the other servers to run a job works, but the rsync command does not run. I'm not sure why this is? Like I said, everything works fine when I run it manually. Any ideas?
Thanks.