Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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