Weblog entry #8 for nicc777

Quick one liner to get all user's crontab entries
Posted by nicc777 on Tue 23 May 2006 at 10:26
Tags: none.

You can try this:

# cat /etc/passwd | perl -e 'while(<>){ chomp; @f=split(/:/,$_); if( ( $f[0] eq "root" ) || ( $f[2] > 999 ) ) { $c="crontab -l -u " . $f[0]; $r=`$c`; print "USER: ",$f[0],"\n----\n\n$r\n\n"; } }'

 

Comments on this Entry

Posted by Anonymous (213.164.xx.xx) on Tue 23 May 2006 at 10:52
I'm not sure why you'd want to do that. Maybe for a backup?
cp /var/spool/cron/*

Or to browse:
less /var/spool/cron/*

[ Parent | Reply to this comment ]

Posted by nicc777 (168.209.xx.xx) on Tue 23 May 2006 at 11:08
[ Send Message | View Weblogs ]
I like to fidle, so this is an alternative to your solution :)



===============================================
=== http://4j.blogspot.com/ ===
=== http://sourceforge.net/projects/lampas/ ===
===============================================

Joh 3:36

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search