Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Quick cron q

  • 02-08-2008 03:12PM
    #1
    Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭


    When I use crontab -e in the terminal window, it pops up with a cron file that has a setting in it that I'm trying to change. However, this is not the crontab file in /etc, but somewhere else. Any idea how I'd find out which crontab file crontab -e is opening?

    PS When it's opened (in nano?) it's given what I can only assume is a temporary name /tmp/crontab.blahblah/crontab and if I make changes here and try to save it's offering to save it as /tmp/crontab.blahblah/crontab - maybe if I confirm this, it will revert to an actual proper crontab?


Comments

  • Registered Users, Registered Users 2 Posts: 2,694 ✭✭✭Dingatron


    What distro? Try looking in /var/spool/cron Then ls -l the dir and check the owner and timestamps maybe..


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Ubuntu v8. I can get to /spool/var/cron and see 3 subdirs there, but I can't access any of them, even as root.


  • Registered Users, Registered Users 2 Posts: 2,694 ✭✭✭Dingatron


    Humm. The crontab should really be edited with crontab -e as the desired user. Make sure to su - into the user rather than just su. Not sure what the sudo swithes are as I don't sudo? Then the modified crontab will be checked for any possible errors and if there are no errors, installed automatically. The file is stored in /var/spool/cron/crontabs but should really only be edited via the crontab command. While your editing I think it creates a /tmp/crontab.blahblah/crontab and then replaces the /var/spool/cron/crontabs/usercrontab once there is no errors. I'm in windows at the min so can't fully check it for you, so this is from memory and the usual disclaimers apply. ;)


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Cheers, that worked.


Advertisement