How to check when cron was modified


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to check when cron was modified
# 1  
Old 11-15-2011
How to check when cron was modified

Hi all,

We use cron "/usr/rdl/sc/cccron" to execute our jobs.
But sometimes it is being changed. but we are not sure when it is changed.

how could we find when cron is modified.

i checked cron by giving ls -l . but it is showing 2009 year.
Code:
ls -l /usr/rdl/sc/cccron
-r-xr-xr-x   1 nassim   rdl        14111 Jun 15  2009 /usr/rdl/sc/cccron

we edit cron with the userid. the user id is test1.

also checked the file
Code:
ls -l /var/spool/cron/crontabs/test1
-rw-------   1 root     rdl          403 Oct 28 14:02 /var/spool/cron/crontabs/test1.

but here it seems oct 28 2011. but i changed this cron with the userid on Nov 15 2011.

Could someone please help?

Thanks & Regards,
Divakar


Moderator's Comments:
Mod Comment Please use code tags!

Last edited by zaxxon; 11-15-2011 at 06:38 AM.. Reason: code tags, see PM
# 2  
Old 11-15-2011
How did you change it?
A good practice is to put the name of user in the cronfile:
Code:
# @(#)B.11.11_LR     
#  ~vbe/crontab.vbe

above meaning the file is in my home directory called crontab.vbe - if date of this file does not match with the file in /var/spool/cron/crontabs, then someone modified my scheduling (dead easy: just be able to [icode] su vbe; crontab -e [/code] but that doesn't modify MY file... and so I can compare and see what has been changed...

The current active scheduling is always in /var/spool/cron/crontabs...
# 3  
Old 11-16-2011
Hi Vbe,

Thanks for the reply.

we edit the cron by giving "cccron -e userid=test1".

in my system, it is like

I logged in with userid

bash-3.00$ pwd
/users/devp/test1

And couldnt see the cron files in the home directory

bash-3.00$ ls /users/devp/test1 |grep cron
cccron.ccall.norespond
cccron.last

then i typed cron and pressed <tab> key, then following are listed.

bash-3.00$ cron
cron cron.d cronsdo crontab

i couldnt work it out as said by you from the above information.

Could you please help?

Thanks & Regards,
Divakar
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can cron be modified via a script?

Hi, From time to time, I have a cron job that I have to enable/disable/enable/disable. I just want to know if there is any way to insert cron entries or do this to enable/disable bit via a script instead. It seems 'safer' to do this via a script rather than manual? I think :confused: or is... (10 Replies)
Discussion started by: newbie_01
10 Replies

2. Shell Programming and Scripting

IF loop to check the time modified

Hi Frnds, i have a folder test in which files generated daily how to chek the files that are modified on that day as a condition for ex, if then echo "i have got something to do with the file" else echo" sorry" fi i will have more than 3 to 4 files that are modified today. and if... (5 Replies)
Discussion started by: mahesh300182
5 Replies

3. UNIX for Advanced & Expert Users

How to find when cron is modified

Hi all, We use cron "/usr/rdl/sc/cccron" to execute our jobs. But sometimes it is being changed. but we are not sure when it is changed. how could we find when cron is modified. i checked cron by giving ls -l . but it is showing 2009 year. ls -l /usr/rdl/sc/cccron -r-xr-xr-x 1... (0 Replies)
Discussion started by: Divakar
0 Replies

4. Shell Programming and Scripting

How to check when cron is modified

Hi all, We use cron "/usr/rdl/sc/cccron" to execute our jobs. But sometimes it is being changed. but we are not sure when it is changed. how could we find when cron is modified. i checked cron by giving ls -l . but it is showing 2009 year. ls -l /usr/rdl/sc/cccron -r-xr-xr-x 1... (0 Replies)
Discussion started by: Divakar
0 Replies

5. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

6. Shell Programming and Scripting

Check what cron is running

How to check what cron is scheduled to run? I don't want to modify anything. Thanks (1 Reply)
Discussion started by: stevensw
1 Replies

7. Shell Programming and Scripting

Script to check if last modified day is previous day

Hi, I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it. For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's... (1 Reply)
Discussion started by: hegdepras
1 Replies

8. Shell Programming and Scripting

How to get a filename modified by attaching modified timestamp

Hi, I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10). For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I... (16 Replies)
Discussion started by: Ruks
16 Replies

9. UNIX for Dummies Questions & Answers

how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes now realised that the changes are not required How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies

10. Shell Programming and Scripting

Check if file modified

Hi, I have a monitoring script that I run, and I would like to automate checking if specific parameter file is modified during the last day or two. How do I do that? (1 Reply)
Discussion started by: nimo
1 Replies
Login or Register to Ask a Question