![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 |
| cron job starts new cron proccess | ron76 | SUN Solaris | 3 | 05-11-2008 10:07 PM |
| Cron and Pseudo-Cron | dingusmcghee | UNIX for Dummies Questions & Answers | 1 | 01-31-2008 09:58 AM |
| CRON usage for CRON job | skyineyes | UNIX for Dummies Questions & Answers | 1 | 01-17-2008 07:17 AM |
| AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log | Keith Johnson | AIX | 0 | 01-09-2008 05:32 PM |
| Cron : you are not authorized to use cron. Sorry. | tt155 | UNIX for Advanced & Expert Users | 1 | 07-06-2005 07:37 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Cron Job
Hi
I want to execute a script on the last day of every month. I tried using the following line but it failed: Code:
50 23 * * * [ `date -d tomorrow +%d` -eq '01' ] && cd live/cgi-bin/;perl org_stats_monthly_cron_job.cgi Code:
CMD: [ `date -d tomorrow + > root 25487 c Mon Apr 30 23:50:00 2007 Could someone please help me out? Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
write the command to a file with #!/usr/bin/ksh at the beginning
make sure the script is executable |
|
#3
|
|||
|
|||
|
Thanks funksen.
So in a file write: Code:
#!/usr/bin/ksh [ `date -d tomorrow +%d` -eq '01' ] && cd live/cgi-bin/;perl org_stats_monthly_cron_job.cgi then in the crontab list put: Code:
50 23 * * * myfile.sh |
|
#4
|
||||
|
||||
|
chmod +x myfile.sh && put in the cron "50 23 * * * /path/to/myfile.sh"
|
||||
| Google The UNIX and Linux Forums |