Sponsored Content
Full Discussion: Trouble with cron
Operating Systems Linux Trouble with cron Post 303018857 by killerserv on Sunday 17th of June 2018 10:59:04 PM
Old 06-17-2018
Trouble with cron

Hello World!
Need some advise. I setup few crons on my server, but to my surprise none of them seems working. Any idea what am i missing here? Is group rights a must in order for cron to run?

Crontab:
Code:
mandrel@sp74t0006c :[/etc/cron.d(14825)]$cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed

mandrel@sp74t0006c :[/etc/cron.d(14825)]$

My cron:
Code:
#################################################################################################################
#
5 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/mapsmove/run_mandrel_mapsmove.sh > /dev/null 2>&1
20 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/oref_inspect/run_oref_inspect.sh > /dev/null 2>&1
25 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/oref_inspect_bdft/run_oref_inspect_bdft.sh > /dev/null 2>&1
30 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/sizedata/run_sizedata.sh > /dev/null 2>&1
35 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/summary/run_sophia_summary.sh > /dev/null 2>&1
0,10,20,30,40,50 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/qc/run_qc_daemon.sh > /dev/null 2>&1
5,15,25,35,45,55 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/ellipsometer/run_ellipsometer_daemon.sh > /dev/null 2>&1
0,10,20,30,40,50 * * * * /opt/fabpkg/home/mandrel/data_adm/sophi/ivs/run_mandrel_ivs.sh > /dev/null 2>&1

---------- Post updated at 10:59 AM ---------- Previous update was at 10:41 AM ----------

Sorry guys, i should have be more careful. Ive screwed up with the paths. Corrected it and now it works.

Kindly delete this thread. My appology!
 

10 More Discussions You Might Find Interesting

1. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

2. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

3. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

4. UNIX for Dummies Questions & Answers

Trouble with cron

Here is what my crontab shows when I do crontab -e # fields minute(0-59) hour(0-23) day(1-31) month(1-12) day of week (0-6, 0=sun) # 30 04 * * 06 /home/rkruck/scripts/shell/backup 15 9 * * * /home/rkruck/scripts/shell/get_passwd_files The first script runs no problem as... (5 Replies)
Discussion started by: rkruck
5 Replies

5. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

6. UNIX for Dummies Questions & Answers

How are cron.allow and cron.deny read?

Hi, all! I was working on my Debian, minding my own business but then I wanted to see what happened if the same user was included on both cron.allow and cron.deny :p I would have bet that cron.deny was going to override cron.allow for security reasons, but my computer proved me wrong:... (3 Replies)
Discussion started by: pereyrax
3 Replies

7. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

8. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

9. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

10. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies
crontab(1)						      General Commands Manual							crontab(1)

NAME
crontab - Submits a schedule of commands to cron SYNOPSIS
crontab [file] crontab -l | -v | -r | -e [username] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: crontab: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Edits a copy of your crontab entry. If the crontab entry does not exist, creates an empty entry to edit. The -e option invokes the editor specified by the EDITOR environment variable, or uses /usr/bin/vi by default. The crontab command installs the new entry when editing is complete. [Tru64 UNIX] If username is specified, edits the file for the specified user. You must have appropriate privileges to use this option. Displays the contents of your crontab file. Removes the crontab file from the crontab directory. [Tru64 UNIX] Displays the name of your crontab file and the date and time at which you submitted it with crontab. OPERANDS
Path name of file that contains crontab specifications in the format described. DESCRIPTION
The crontab command copies the specified file or standard input if you do not specify a file into the /var/spool/cron/crontabs directory, which holds all users' crontab files. The cron command runs commands according to the instructions in the crontab files. The crontab files are named for users, and the commands in the files are run under the user's authority. For example, the commands in the /var/spool/cron/crontabs/root file are run under root authority. When you use the crontab command, the file under your authority is affected. For example, if adm invokes the crontab -l com- mand, the /var/spool/cron/crontabs/adm file is displayed. If the username argument is included, the specified user's crontab file is listed and edited rather than the current user's crontab file. You must have root privileges to specify the username argument. By default, the vi editor is used. Note that the file /var/spool/cron/crontabs/root contains several entries that will run by default, such as the following command to back up and clean the /var/adm/wtmp log file: 0 2 * * 0 /usr/bin/logclean /var/adm/wtmp > dev/null You can configure these default commands to suit your local system requirements. After cron runs commands according to the contents of your crontab file, it mails you the output from standard output and standard error for these commands, unless you redirect standard output or standard error. Note When entries are made to a crontab file by using the crontab command, all previous entries in the file are removed. You can use the crontab command if your user name appears in the /usr/lib/cron/cron.allow file. If that file does not exist, the crontab command checks the /usr/lib/cron/cron.deny file to determine if you should be denied access to crontab. The allow/deny files contain one user name per line. If neither file exists, you can submit a job only if you are operating with superuser authority. Each crontab file entry consists of a line with six fields, separated by spaces and tabs. The information in the fields specifies when the command runs and the name of the command. The fields specify the following: The first field specifies the minute (0 to 59). The second field specifies the hour (0 to 23). The third field specifies the day of the month (1 to 31). The fourth field specifies the month of the year (1 to 12). The fifth field specifies the day of the week (0 to 6 for Sunday to Saturday). The sixth field specifies the shell com- mand to be executed. You can specify the following values in the fields that indicate the time: An integer (within the appropriate range of values) Two integers separated by a dash to indicate an inclusive range A list of integers separated by commas An asterisk to select all possible values You can specify the days on which the command is to execute in two fields (day of the month and day of the week). You can specify both fields, or you can specify only one field. To use only one field to specify the days, the other field should contain an asterisk (*). If both methods are used, the command is executed whenever either of the specifications is met. [Tru64 UNIX] For example, the following entry runs command at midnight on the first and fifteenth days of each month, as well as every Monday: 0 0 1,15 * 1 command The cron program runs the command named in the sixth field at the specified date and time. If you include a percent sign (%) in the sixth field, cron treats everything that precedes it (in that field) as the command invocation, and makes all that follows it available to stan- dard input, unless you escape the percent sign (\%) or double quote it ("%"). An exclamation point (!) in the sixth field is translated as a newline character. The shell runs only the first line of the command field (up to a percent sign or End-of-Line). All other lines are made available to the command as standard input. The cron program invokes a subshell from your $HOME directory. This means that it will not run your file. If you schedule a command to run when you are not logged in and you want to have commands in your run, you must explicitly do so in the crontab file. (For a more detailed discussion of how sh can be invoked, see the sh command.) The cron program supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=:/usr/bin). [Tru64 UNIX] To submit commands to the cron daemon, invoke the crontab command with the -e option, or perform the following tasks: [Tru64 UNIX] Become the user that corresponds to the appropriate file in the /usr/spool/cron/crontabs directory. For example, if you want to submit commands that will run under adm authority, become user adm. [Tru64 UNIX] Use the crontab command with the -l option to copy the appropriate file from the /usr/spool/cron/crontabs directory to a temporary file in your home directory. For example, if you are user adm, you could use the following command: crontab -l > temp_adm [Tru64 UNIX] Edit the temporary file and add the commands you want to run at a specified time. [Tru64 UNIX] Use the crontab command and specify the temporary file to submit the commands to the cron daemon. NOTES
When entries are made to a crontab file, all previous entries are erased. If your user ID is associated with more than one user name, crontab uses the first user name that appears in the /etc/passwd file, regardless of which user name you might actually be using. [Tru64 UNIX] The file /usr/lib/cron is a symbolic link to /var/adm/cron. [Tru64 UNIX] If cron.allow exists, the superuser's user name must appear there for that superuser to be able to use the command. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred. EXAMPLES
The following example writes the time to the console every hour on the hour: 0 * * * * echo The hour is `date`. >/dev/console The following example runs calendar at 6:30 a.m. every Monday, Wednesday, and Friday: 30 6 * * 1,3,5 /usr/bin/calendar - The following example writes the contents of happyholidays.txt to all users logged in at 4:00 p.m. each Friday in December and each day between December 10 and December 31 inclusive: 0 16 10-31 12 5 /usr/sbin/wall /var/tmp/happyholidays.txt ENVIRONMENT VARIABLES
The following environment variables affect the execution of crontab: Determines the editor used with the -e option. Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte char- acters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
Main cron directory. Directory containing the crontab files adm, cronuucp, root, sys,and uucp. List of allowed users. List of denied users. Log of cron activity. Queue description file for at, batch, and cron. Contains user information. User profile. SEE ALSO
Commands: at(1), cron(8), mail(1), mailx(1), Bourne shell sh(1b), POSIX shell sh(1p) Files: queuedefs(4) Standards: standards(5) crontab(1)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy