I love cron, but there are few details missed from most of the users:
1. It's wise to set only one command to be executed, do not play with one long line, just a little script. This will help to avoid errors and problems.
2. Force set environment variables you need for script. Script run by cron have very limited set of variables. Better add as first line of script:
. /my/home/.profile
or startup file for your shell (.bash_profile for example if you use bash as default shell)
3. As first line in your script set shell need for execution, do not rely on default one. This is named shebang and here you can find very good explanation what is this and how to use it.
4. Do not play with tricky sets of minutes, hours, etc. Use full citation, this will work on all UNIXes and Linux and give much better visibility:
0,10,20,30,40,50 * * * * /path/myscript
5. Be careful when you use the days of week. Beside other time variables which "use" AND as logical function between them Day of week use OR to the day of month.
Subscribe to:
Post Comments (Atom)
Compressed tar archive
There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...
-
To build firewall under AIX is sample, but as each host based firewall should be done careful 1. Prerequisites To start firewall in AIX yo...
-
There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...
-
4. Its time for some system administrator tasks. Oracle ASM need special mark of disks will work with 4.1. Because of some reason (i don...
No comments:
Post a Comment