09-21-2010
Were you logged in as "root" or as a normal user?
If this is an operational system you will be advised to get your Systems Administrator to repair the problem.
Assuming this is a training course on an expendable test system we can continue.
If you were logged in as root you have attempted to replace your root crontab with a file called "a.cron". This failed.
However I would have expected the error message:
"crontab: error on previous line; unexpected character found in line."
Even with your error message I doubt if it changed the crontab.
The script called "a.cron" contains errors. As a minimum in unix all backslash (\) characters should be solidus characters (/) in pathnames. If you have not tested the script you should not put it into a cron.
After repairing the script. You probably just need to run "crontab -e" again and change each backslash (\) to solidus (/). This is because unix syntax for a path is different from Microsoft syntax for a path.
10 More Discussions You Might Find Interesting
1. Programming
here's the problem, i have two processes that i need to run and both process should be run at a total of 1 minute each. how do i do that? and one more here's what the processes do: the 1st process show the '+" sign infinitely while the 2nd process displays the "-" infinitely. how could i count the... (1 Reply)
Discussion started by: kelogs1347
1 Replies
2. Shell Programming and Scripting
Hi.
I can run the script okay when I log in with root. Then I add this script to crontab and when crontab run i got this message error.
I has installed DBD for Oracle already. I set ORACLE_HOME, ORACLE_BASE to root profile already.
Please help me to fix it. It urgent. Thank so much.
... (2 Replies)
Discussion started by: raccsdl
2 Replies
3. Shell Programming and Scripting
I am using Solaris 9. I wish to run my script every 1 minute inteval. Though i can run it using below entry in crontab.
* * * * /export/home/username/script/file_exist_&_run.sh
in short above script will check whether a specific file exist in a directory. If it found it will inovke another... (10 Replies)
Discussion started by: thepurple
10 Replies
4. UNIX for Advanced & Expert Users
when i say
$crontab z
it says ==>
"z":6: bad minute
"z":6: bad minute
errors in crontab file, can't install.
any clue why its happening? (1 Reply)
Discussion started by: crackthehit007
1 Replies
5. Shell Programming and Scripting
How to set crontab for every minute or every hour (1 Reply)
Discussion started by: kaushik02018
1 Replies
6. AIX
In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all.
* * * * * script.sh
When I run it manually, I can run it. Is that anything wrong with the above line?
If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies
7. Solaris
Hi everyone,
I got error which is "!bad user (root)" in crontab...
I tried changing password,
I checked etc/cron/cron.allow and cron.deny,
And also I checked the permissions of my files,
its(my crontab script) still not working....
Please help... (12 Replies)
Discussion started by: ijustneeda
12 Replies
8. Shell Programming and Scripting
Hi Friends,
I have developed a standalone java application which is deployed in a Linux environment. I have created a script for starting this application if the process is not running or else do nothing.
The application is deployed as a .jar. I have also created a crontab entry like this... ... (1 Reply)
Discussion started by: Binoy Sankar
1 Replies
9. Shell Programming and Scripting
Hi All,
While setting the crontab i am getting the below error,
"/tmp/crontab.XXXXwKymEc" 156L, 15621C written
crontab: installing new crontab
"/tmp/crontab.XXXXwKymEc":74: bad hour
Please help.
Thanks (2 Replies)
Discussion started by: nag_sathi
2 Replies
10. Shell Programming and Scripting
when it runs and look at my acron.log file it generates an error as below
/tmp/prog.sh: line 4: (12 Replies)
Discussion started by: azherkn3
12 Replies
CRON(8) BSD System Manager's Manual CRON(8)
NAME
cron -- daemon to execute scheduled commands (ISC Cron V4.1)
SYNOPSIS
cron [-n] [-x debugflags]
DESCRIPTION
cron is normally started during system boot by rc.d(8) framework, if cron is switched on in rc.conf(5).
It will return immediately so you don't have to start it with '&'.
cron searches /var/cron/tabs for crontab files which are named after accounts in /etc/passwd. Crontabs found are loaded into memory. cron
also searches for /etc/crontab which is in a different format (see crontab(5)). Finally cron looks for crontabs in /etc/cron.d if it exists,
and executes each file as a crontab.
When cron looks in a directory for crontabs (either in /var/cron/tabs or /etc/cron.d) it will not process files that:
- Start with a '.' or a '#'.
- End with a '~' or with ``.rpmsave'', ``.rpmorig'', or ``.rpmnew''.
- Are of zero length.
- Their length is greater than MAXNAMLEN.
cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When
executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab,
if such exists).
Events such as START and FINISH are recorded in the /var/log/cron log file with date and time details. This information is useful for a num-
ber of reasons, such as determining the amount of time required to run a particular job. By default, root has an hourly job that rotates
these log files with compression to preserve disk space.
Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab or /etc/cron.d) has changed,
and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted when-
ever a crontab file is modified. Note that the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.
The following options are available:
-x This flag turns on some debugging flags. debugflags is comma-separated list of debugging flags to turn on. If a flag is turned on,
cron writes some additional debugging information to system log during its work. Available debugging flags are:
sch scheduling
proc process control
pars parsing
load database loading
misc miscellaneous
test test mode - do not actually execute any commands
bit show how various bits are set (long)
ext print extended debugging information
-n Stay in the foreground and don't daemonize cron.
Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused by the start or end of Daylight Saving Time, are handled specially. This
only applies to jobs that run at a specific time and jobs that are run with a granularity greater than one hour. Jobs that run more fre-
quently are scheduled normally.
If time has moved forward, those jobs that would have run in the interval that has been skipped will be run immediately. Conversely, if time
has moved backward, care is taken to avoid running jobs twice.
Time changes of more than 3 hours are considered to be corrections to the clock or timezone, and the new time is used immediately.
SIGNALS
On receipt of a SIGHUP, the cron daemon will close and reopen its log file. This is useful in scripts which rotate and age log files. Natu-
rally this is not relevant if cron was built to use syslog(3).
FILES
/var/cron/tabs cron spool directory
/etc/crontab system crontab file
/etc/cron.d/ system crontab directory
/var/log/cron log file for cron events
SEE ALSO
crontab(1), crontab(5)
AUTHORS
Paul Vixie <vixie@isc.org>
BSD
October 12, 2011 BSD