![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| crontab couldn't run through, help | duke0001 | UNIX for Advanced & Expert Users | 10 | 02-05-2008 11:22 PM |
| help with crontab | bob122480 | Shell Programming and Scripting | 3 | 01-22-2007 04:49 PM |
| Crontab | gen4ik | UNIX for Dummies Questions & Answers | 1 | 01-18-2007 03:26 AM |
| ftp and crontab | user` | Shell Programming and Scripting | 27 | 11-13-2006 04:02 PM |
| Crontab | lo-lp-kl | UNIX for Dummies Questions & Answers | 2 | 05-05-2005 03:21 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
crontab help
Hi All,
Please help me in understanding the crontab entries and also below queries 1. how can we set a crontab entry 2. from where the cronjob will run( if default) 3. you can we specify the location from which the cronjob should run. 4. how can we capture the output of the cronjob. Thanks Satish |
| Forum Sponsor | ||
|
|
|
|||
|
crontab -issue
crontab if not specified will run fron root users account ,location as in which program u want to run or what please be more clear,the man pages will be good place to start with and also you can capture the output of crontab by redirecting the output to some file instead of /dev/null.
|
|
|||
|
Creating crontab! files! Who runs crontab?
Hi
If you want a specific user to run a crontab (root, myself, yourself, etc) then the easy way is to log into that users account and create the crontab entry: "crontab -e" This gives you YOUR OWN (or that users) crontab file to edit, using say "vi", or "gvim, whatever is the default editor. Save and exit the changes with: ":wq" from inside the text editor. Use "crontab -l" to view the YOUR OWN (or that users) crontab contents - without the risk of editing it. Bye GrahamB |
|
|||
|
Output from crontab
Hi Satish:
Your last question: how can we capture the output of the cronjob. Use the directional parameters "> $file" and/or ">> $file" for example. Anything that goes to stdout would then be routed to $file. Any other stdoutput would, for example go into the mail of the user who has called the crontab-job. Try something like this: Code:
10 4 * * * . ~/.bashrc; ${SCRIPTS}/backup_mysql.sh >> ${BACKUPS_LOG}/${HOSTNAME}_mysql_v${VERS}.script.log 2>&1
Above the redirection is to a log-file describing the overall performance of the program and the variable used by "./backup_mysql.sh". This logs data that would be of interest to the administrator, for example. Note: "2>&1" is also a redirection. Another story! regards GrahamB |
|
|||
|
crontab -issue
Hi
the 2 >&1 represent standard error that is represented as 2 should also be redirected where the standard ouput has been directed it is a posix notation and can be found in man sh posix hope this will clear your doubt. Goodluck |
| Thread Tools | |
| Display Modes | |
|
|