Facing issues while running a cronjob !


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Facing issues while running a cronjob !
# 1  
Old 07-12-2012
Facing issues while running a cronjob !

Hi,

I am trying to run a cronjob. But while doing so I am getting the following error message :-


Code:
can't open yourfile in /var/spool/cron/crontabs directory.
No such file or directory


How can I resolve this issue ?

Please help.

Thanks
Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.
# 2  
Old 07-12-2012
Well the error messgae suggests it is not there...
Did you look inside /var/spool/cron/crontabs directory?

How did you load your job scheduling?
# 3  
Old 07-12-2012
hi,

Thanks for prompt reply !

When I am trying to access the path. The below message is shown :-

Code:
 
ABC@XXX:/var/spool/cron# cd crontabs
ksh: crontabs: permission denied

I tried to load the job scheduling from this ABC user account.

Does it means that this user can't do the job scheduling ?

Should I try to do the job scheduling from root/admin account ?

Please suggest !
# 4  
Old 07-12-2012
/var/spool/cron/crontabs is often only accessible to root but not always :
Code:
zra:/var/spool/cron $ ll
total 8
dr-xr-xr-x   5 bin        bin           1024 Oct  4  2011 .
dr-xr-xr-x  15 bin        bin           1024 Jun 11  2002 ..
dr-xr-xr-x   2 bin        bin             96 Oct  4  2011 atjobs
-r--r--r--   1 bin        bin            342 Nov  7  1997 crontab.root
dr-xr-xr-x   2 bin        bin             96 Nov 24  2010 crontabs
drwxrwxrwt   2 root       sys           1024 Jul 11 20:20 tmp

it contains the cron of users allowed to use cron, for that you will have to look in /var/adm/cron what you have in cron.allow ( or cron.deny) file

Next question : Where is your cron file ? a good habit is to put in comment where it is to be found and always load /modify it there ( can be in user home directory...) because I saw a few times people desperate having lost their file, have no copies of it since they only use(d)
Code:
crontab -e

( meaning they are using the system's copy in /var/spool/cron/crontab).

Last edited by vbe; 07-12-2012 at 11:13 AM..
# 5  
Old 07-12-2012
I tried using the ABC to get the details using :-
Code:
ABC@XXX:/var/spool/cron# ls -l
total 0
drwxrwx---    2 bin      cron            256 Jan 19 11:31 atjobs
drwxrwx---    2 bin      cron            256 Jul 10 16:24 crontabs

From this it seems that the user ABC is not listed here !
Afterwards I tried the same using root account and the following was displayed :-
Code:
root@XXX:/var/spool/cron/crontabs# ls -l
total 56
-rw-r--r--    1 adm      cron           2020 Feb 28 2007  adm
-rw-------    1 root     cron            222 Jan 22 2008  hostmon
-rw-------    1 root     cron            225 Jul  9 15:15 root
-rw-------    1 root     cron             85 Jun 22 15:11 root-5JULLY2012
-rw-r--r--    1 sys      cron            853 Feb 28 2007  sys
-rw-------    1 root     cron            199 Jul 10 16:24 tcadm
-rw-r--r--    1 root     cron           1122 Feb 28 2007  uucp





Other issue :- When I executed the following I am getting
Code:
root@XXX: /PPP/TRY/pXX/ACV/XXX/XXX /logs# crontab -l
14 15 22 6 5 /PPP/TRY/pXX/ACV/XXX/XXX/XXX/CronScriptCheck/Script.ksh
20 15 * * *  /PPP/TRY/pXX/ACV/XXX/XXX/XXX/CronScriptCheck/ AScript.ksh 

Now with the above job scheduling can I run another job scheduling at the same time in parallel to all or do I have to club all these jobs in one cronjob ?

Please suggest !
# 6  
Old 07-12-2012
If you have root account, then add your user in cron.allow (in /var/adm/cron/ directory) if cron. allow does not exist nor cron.deny (or cron.deny empty...), then anybody can use cron...

The best is to have a cronfile per user / product admin, but then you have no idea what is scheduled unless you read all the files... One is the best for reading and to see for performance issues /contention etc but then on that (root?) person can modify/change... Not suitable in production environments where DBAs are not going to let anyone touch what they plan nor sysadmin, and so you find a few operators with production job scheduling
# 7  
Old 07-12-2012
Here is from a aix (6.1) box:
Code:
n12:/home/vbe $ ll /var/adm/cron
total 116520
dr-xr-x---    2 bin      cron            256 Apr 30 2009  .
drwxrwxr-x   14 root     adm            4096 Jul 11 2011  ..
prw-------    1 root     cron              0 Jul 12 16:15 FIFO
-rw-r-----    1 bin      cron              4 Apr 30 2009  at.deny
-rw-r-----    1 bin      cron              3 Apr 30 2009  cron.deny
-rw-rw-r--    1 bin      bin        59620574 Jul 12 16:55 log
-rw-r--r--    1 root     sys            1313 Apr 30 2009  queuedefs

You can have only one of the files cron.allow OR cron.deny, here having cron.deny empty means all can use cron...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Facing issues with shell script changes

My current requirement is to replace xxyxx string with value of date date1 variable holds a date and the current script writes html tags to a file as follows echo date1 nawk 'BEGIN{ FS="," print "<HTML>""<HEAD>""<p>Hi All,<br><br>There are no cases closed on the xxyxx" print ... (2 Replies)
Discussion started by: Rajesh A S
2 Replies

2. Shell Programming and Scripting

Facing issues with rsync

Hello Gurus, I am running rsync command to copy certain Directories and files into that directories to remote server. While ruuning the command all teh files has been copied but I am facing error. The below command I am executing to copy Directories and files to remote server: rsync -avrz ssh... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

3. Post Here to Contact Site Administrators and Moderators

Regarding facing issues while accessing UNIX.com site

Hello Moderators/Admins, This is regarding an issue which I am facing from last 7 to 8 days. Issue is while trying to access this forum(simple hitting http://unix.com) I am able to login but many times my request gets timed out or 404 error or if I am able to login it will be excessive slow even... (0 Replies)
Discussion started by: RavinderSingh13
0 Replies

4. Shell Programming and Scripting

Facing issues with cronjobs

Hello Everyone, We have a cronjob scheduled to pick up files from one system and transfer to another system. the underlying code is a shell script. These cronjobs were working correctly until sometime. 2 days back they did not pick up the scripts but created empty logs. However when we tried... (6 Replies)
Discussion started by: Rads
6 Replies

5. UNIX for Dummies Questions & Answers

Having some issues with cronjob

Hi, i have a cronjob scheduled to run daily at 7AM , the job which i am executing has three other scripts in it to execute. The first scripts gets executed perfectly but the 2nd and 3rd scripts which take 4-5 mins to complete does not executes,is there anything that i am missing. This is... (3 Replies)
Discussion started by: vikatakavi
3 Replies

6. Shell Programming and Scripting

Facing issues with tar and gzip !

Hi, I am trying to :- (1.) Tar the file and then (2.) Gzip it ! Tar command :- tar -cvf BLUESTAR_Archive.log_$(date +%y_%m_%d_%H_%M).tar /app/local/XXX/XXX/XXX/logs Gzip command :- Gzip /app/local/XXX/XXX/XXX/logs/BLUESTAR_Archive.log_$(date +%y_%m_%d_%H_%M).tar ... (9 Replies)
Discussion started by: acidburn_007
9 Replies

7. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

8. UNIX for Dummies Questions & Answers

Issues with cronjob : Script using sendmail

Hi All, I am new to unix. I have created a cron job, that sends mail using sendmail utility. Am facing a unique problem while making a cron job for this script. In the script I append a file to my mail using 'cat' command. cat $report >> $mailMsg & this $mailMsg is used as mail... (7 Replies)
Discussion started by: anshulporwal
7 Replies

9. Shell Programming and Scripting

Facing issue in Solaris OS in crontab for running shell script

Hello i have a shell script. it is running fine when i manually run at command prompt using following command ./script_file but while running shell script from crontab, it is giving error in each line. (2 Replies)
Discussion started by: mabrar
2 Replies

10. HP-UX

Facing an issue related to cronjob

Dear All, I am facing an issue related to cronjob and explained below is the case study: 1. I have a java class named "DmCheckRenditionQueue.java" and placed under "/cpc/documentum/product/5.2.5/tomcat/webapps/rendition" 2. When I am using the command "/usr/openv/java/jre/bin/java -cp... (1 Reply)
Discussion started by: parindam
1 Replies
Login or Register to Ask a Question