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
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Displaying cron jobs for all users.

  • 20-09-2007 9:15am
    #1
    Registered Users, Registered Users 2 Posts: 8,750 ✭✭✭


    Hi,
    There was a post on this forum which seems to have disappeared :( . It showed how to get a crontab listing for all users by parsing the passwd file and then display the crons for each user found.

    Can anybody remember how this was done?


Comments

  • Registered Users, Registered Users 2 Posts: 223 ✭✭anonymousjunkie


    This is probably it, if you're talking linux anyway

    cut -d: -f1 /etc/passwd | grep -vE "#" | xargs -i{} crontab -u {} -l


  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    you could look in /var/spool/cron/crontabs


  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    I was gonna suggest:

    crontab -l | tee `awk -F":" '{ print $1}' /etc/passwd

    I tested this on Solaris 10 and it works. It wont work on SuSE 9.2 as it seems tee is only passing back the first user, which is root.


  • Registered Users, Registered Users 2 Posts: 8,750 ✭✭✭degsie


    Thanks guys, I have something to go on from here. I need this for Solaris 8 & 9 and for Tru64 systems. Thanks again.


  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    the command i posted should work for you so, the only problem is there is no way of identifying which crontab belongs to which user then they are all together


  • Advertisement
  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    One point to note is that /etc/passwd isn't necessarily an authoritative list of all user accounts on a system. It is only one potential source albeit the most common. It's a far better idea to use 'getent passwd' in any scripts that do this as it will include all potential NSS passwd sources (LDAP, NIS, PAM-MySQL, ...) and as such avoid problems should extra sources be added.


  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    thats a nice command, thanks


Advertisement