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.

View all CRON jobs

  • 13-03-2007 11:49AM
    #1
    Closed Accounts Posts: 25,848 ✭✭✭✭


    Hi guys,

    Is there a way as root to view all cron jobs that are set up to run for all users on Fedora?

    I know you can crontab -l -u "username" for each individual user as root, but I'm trying to track down a rouge process and I've no idea what user it is being started under

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 568 ✭✭✭phil


    All cronjobs should be logged to /var/log/cron with the user it is run as (so you have a historical reference)

    I think FC5 uses vixie-cron, so you should have a list of current active cronjobs in /var/spool/cron

    e.g.
    $ sudo ls /var/spool/cron/
    phil  root
    $
    

    That's a cronjob file for my user 'phil' and the 'root' user on my system. They're plain text files, so use less/more/cat or your favourite editor to view them. Obviously, try not to modify the files and use crontab(1) to do that.

    Explain to us a bit more about the rogue process and we might be able to help you track it down.

    Phil.


  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    Wicknight wrote:
    Hi guys,

    Is there a way as root to view all cron jobs that are set up to run for all users on Fedora?

    I know you can crontab -l -u "username" for each individual user as root, but I'm trying to track down a rouge process and I've no idea what user it is being started under

    Thanks
    it would probably be easier to do this using

    ps aux | grep "process name"


  • Registered Users, Registered Users 2 Posts: 545 ✭✭✭ravydavygravy


    as root, run the following:

    cat /var/spool/cron/* /etc/cron.d/* /etc/crontab

    to list all currently set cronjobs.

    Alternativly, if you need to see what each user has setup, try this:

    for USER in `cat /etc/passwd | grep sh | awk -F: '{print $1}'`
    do
    echo "Crontab for $USER:"
    crontab -u $USER -l
    echo
    done

    Hope this helps....


Advertisement