View crontab entries of entire user in FreeBSD

Cron is special utility that process command in periodic time such ;

  • doing regular backup every night
  • email special report every week
  • etc

cron access can be usefull but sometime not, depend on the command issued.

As super user we can list all of entire user crontab entries using log locate in /var/log

su-2.05b# tail -f /var/log/cron
Apr 30 20:30:00 erau /usr/sbin/cron[81893]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:30:00 erau /usr/sbin/cron[81894]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84459]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84462]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87061]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87062]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90181]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90180]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93304]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93305]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)

pay attention on (root) entries, that mean user who run that command in this case generate data for cacti.

You can run the command as root or sudo, otherwise you’ll get “permission denied” message

-bash-2.05b$ tail -f /var/log/cron
tail: /var/log/cron: Permission denied
-bash-2.05b$ su
Password:
kongja# tail -f /var/log/cron
Apr 30 20:36:00 kongja /usr/sbin/cron[81442]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:37:00 kongja /usr/sbin/cron[81504]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:38:00 kongja /usr/sbin/cron[81567]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:39:00 kongja /usr/sbin/cron[81631]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)

happy viewing 🙂

P.S :

other usefull place to check for cron entries

/var/cron/tabs
/var/cron/atjobs
/etc/crontab

in Unix | 343 Words

no eth0 in FreeBSD?

Convention in Linux for network interface simple and clear.

eth for cable connection

ath or wifi for wireless connection

l0 for loopback

sample from my ubuntu feisty fawn box :

[email protected]:~$ ifconfig -a

ath0  Link encap:Ethernet� HWaddr 00:14:A4:70:02:3E
inet addr:192.168.12.100� Bcast:192.168.12.255� Mask:255.255.255.0
inet6 addr: fe80::214:a4ff:fe70:23e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST� MTU:1500� Metric:1
RX packets:8945 errors:0 dropped:0 overruns:0 frame:0
TX packets:6503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5854116 (5.5 MiB)� TX bytes:1133161 (1.0 MiB)

eth0 Link encap:Ethernet� HWaddr 00:0A:E4:F1:CC:ED
UP BROADCAST MULTICAST� MTU:1500� Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b)� TX bytes:0 (0.0 b)
Interrupt:23 Base address:0xe000

eth0:avah Link encap:Ethernet� HWaddr 00:0A:E4:F1:CC:ED
inet addr:169.254.12.119� Bcast:169.254.255.255� Mask:255.255.0.0
UP BROADCAST MULTICAST� MTU:1500� Metric:1
Interrupt:23 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1� Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING� MTU:16436� Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:346 (346.0 b)� TX bytes:346 (346.0 b)

Continue reading

ZFS and FreeBSD current

Very interesting to see progress of ZFS in FreeBSD, comitted in FreeBSD 7 ( will release in 2007). This excellent job done by Pawel Jakub Dawidek with collaboration with opensolaris  for suitable patch .

Many feature that ZFS offer that make me hard to blink till see last pages of presentation

Pawel also give quick guide to implement ZFS at FreeBSD

How about jails?  Just check this blog for more ilustrative example

For me ZFS will be alternative for storage pools beside gvinum, gconcat or gstripe  with self healing capabilities.

Soon … coming soon I’ll try ZFS, started from updating SRC 🙂

zfs.PNG

zfs_cow_fig1.jpg

P.S : DragonFly will port ZFS too

in PHP | 104 Words

xcache, another php cache with stable operation orientation

During my last search on eaccelerator progress ( in time of writing 0.9.5) i found new link to another php cache :

xcache

since it’s made by author of lighttpd i’m eager to try it out in my freebsd server.

1. updating freebsd ports

2. install from ports

# cd /usr/ports/www/xcache && make install

3. Copying ini file

# cp /usr/local/share/examples/xcache/xcache.ini /usr/local/etc/php/

4. creating md5 password 🙂

# md5 -s ‘openbsd’

copy generated md5 into : xcache.ini

# ee /usr/local/etc/php/xcache.ini

Continue reading

in PHP | 133 Words