Operating System - HP-UX
1833780 Members
2386 Online
110063 Solutions
New Discussion

two cron jobs in my crontab...

 
SOLVED
Go to solution
Denise_22
Advisor

two cron jobs in my crontab...

In /var/spool/cron/crontabs I have two files listed there. They are the same and I want to remove one of them. The file is called cronfile and how do I remove this cleanly?

Do I use this command

crontab -r cronfile?

Thanks.
carpe diem
3 REPLIES 3
Patrick Wallek
Honored Contributor
Solution

Re: two cron jobs in my crontab...

Do you have a user called 'cronfile'? If not, you can just 'rm cronfile' to remove it.

The files that reside in /var/spool/cron/crontabs, the actual users' crontab files themselves, are named according to the user to which they belong. root's crontab is named root in that directory. A file named 'cronfile' sounds like a backup that someone made at some point.
Denise_22
Advisor

Re: two cron jobs in my crontab...

We do not have a user name cronfile. I may have done this inadvertently because I may have been in the /var/spool/cron/crontab directory when I did this

crontab -l >cronfile
vi cronfile
crontab cronfile

This would probably create the cronfile because I was in that directory.

I did not realize I could remove it with rm cronfile.

I think crontab -r removes the crontab file for the user. It makes sense that rm cronfile is used in this case.

Thanks.
carpe diem
Helen French
Honored Contributor

Re: two cron jobs in my crontab...

The files in /var/spool/cron/crontabs get created when each user in your system creates their own crontabs. If root has a crontab setup, you should have a file name called "root" their and like that for each user. Check if cronfile user exists or you can remove it.

Also, first instead of removing it (rm) I will move it some other place, just for safety. You can even check the content of the file with cat command and confirm what process it initiates.
Life is a promise, fulfill it!