Computing.Net > Forums > Linux > running crontab at last day of mont

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

running crontab at last day of mont

Reply to Message Icon

Name: rg2dm
Date: May 25, 2005 at 11:51:30 Pacific
OS: Fedora 3
CPU/Ram: 2.8ghz / 512MB
Comment:

Trying to run a command on the last day of the month. Below is my cron entry. However, it returns an error. I am assuming there is a syntax error, but I have tried many combinations with quotes, ticks, double quotes, etc.

36 14 * * * [ `date -d tomorrow +%d` -eq '01']&& /root/test

Error:
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file

Please help, as I am new to Linux



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: May 25, 2005 at 15:53:01 Pacific
Reply:

Since you are new to GNU/Linux, I won't say RTFM then ;-)

Try replacing +%d with +\%d

(man 5 crontab)


0

Response Number 2
Name: David Perry
Date: May 26, 2005 at 04:08:55 Pacific
Reply:

Here is a previous thread.

http://www.computing.net/unix/wwwboard/forum/6661.html


0

Response Number 3
Name: Wolfbone
Date: May 26, 2005 at 04:33:16 Pacific
Reply:

That thread may not be very helpful. From the manpage:

The ``sixth'' field (the rest of the line) specifies the command to be run.
The entire command portion of the line, up to a newline or % character, will
be executed by /bin/sh or by the shell specified in the SHELL variable of
the cronfile. Percent-signs (%) in the command, unless escaped with back-
slash (\), will be changed into newline characters, and all data after the
first % will be sent to the command as standard input.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: running crontab at last day of mont

To run a program at the time of booting www.computing.net/answers/linux/to-run-a-program-at-the-time-of-booting/1957.html

Xfce4 run command at startup www.computing.net/answers/linux/xfce4-run-command-at-startup/28835.html

Masquerading problem with iptables www.computing.net/answers/linux/masquerading-problem-with-iptables/25107.html