1821870 Members
3219 Online
109638 Solutions
New Discussion юеВ

viewing crontab

 
SOLVED
Go to solution
Shivkumar
Super Advisor

viewing crontab

Dear Sirs,

Is there any precaution required while viewing the crontab entries by using the command "crontab -l" as a powerbroker user ?

Thanks,
Shiv
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: viewing crontab

NO

live free or die
harry d brown jr
Live Free or Die
Rita C Workman
Honored Contributor

Re: viewing crontab

Well crontab -l is simply to view the cronfile...it doesn't change it. If you have rights, and rights can be distributed via Powerbroker, than you can run the command.

Rgrds,
Rita
Kent Ostby
Honored Contributor

Re: viewing crontab

this should not cause any problems, however, it will only list the crontab for the current user if you do simply crontab -l

If you wish to see, for instance, root's crontab, you would need to look at the actual file or run crontab -l as the root user.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Rick Garland
Honored Contributor

Re: viewing crontab

The '-l' option to the crontab command is just that - list. Will not allow edits and will just scroll by on the screen until end of file.

You can pipe the output to '|more' so you can view a screen at a time.

I am more careful with the 'r' key next to the 'e' key
crontab -e edit the crontab
crontab -r remove the crontab (OUCH!!!)


A. Clay Stephenson
Acclaimed Contributor

Re: viewing crontab

No, just make sure that you specify the "-l" option; for example, if you did, crontab and then triggered an End-of-file (Ctrl-D, for example) thinking the command was hung, you just rewrote the crontab with a null file.
If it ain't broke, I can fix that.
Sandman!
Honored Contributor

Re: viewing crontab

Clay pointed out a very important pitfall about crontab. In case you mistakenly typed crontab at the command line hit "Ctrl-C" to avoid overwriting your crontab file with a null file.

regards
Basheer_2
Trusted Contributor
Solution

Re: viewing crontab

Hi Shiv

As a precaution, I always make a backup copy of crontab roots and others before accidentally typing crontab -r
Geoff Wild
Honored Contributor

Re: viewing crontab

Crontabs can be viewed by root in:

/var/spool/cron/crontabs

Another thing you can do is:

crontab -l > mycrontab

then use your favourite editor (like vi) or just more or cat mycrontab

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.