![]() |
|
Other BSD and UNIX/UNIX-like Any other flavour of BSD or UNIX that does not have a section of its own. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]() Quote:
|
|
|||
![]()
I haven't used Linux for a long time, but doesn't crontab -e allow you to add a task to your personal cron table?.
For an automatic pruning after 48 hours you could use the find command. The following shows a listing of all files in my home dir older then file 48 hours Code:
$ find /home/j65nko/ -ctime 2 2 -exec ls {} \; ![]()
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
![]()
The cron "system" usually includes an at(1) command.
Example: Code:
$ echo sh bin/script | at 1am tomorrow commands will be executed using /bin/ksh job 1240290000.c at Tue Apr 21 01:00:00 2009 $ You can also use "now +" -- specific to your needs: $ echo rm /path/to/file | at now + 48 hours Last edited by jggimi; 21st April 2009 at 01:16 AM. |
|
|||
![]() |
|
||||
![]()
The man page is what I used; granted, it required a little experimentation before I figured it out. And, if I don't use it for six month or a year, I forget everything and have to start over, and learn it again.
At has two types of time specifications. If you use "-t <timespec>", the "timespec" is a single format, starting with an optional century, then optional year, then month, then day, then hour, then minute, then optional seconds: e.g: 200905012315.30 = this coming May 1, at 23:15:30. 05012316 = the same evening, 30 seconds later, at 23:16:00 The other formats that do not use -t are much more loosely defined. |
|
||||
![]()
The find command via cron is much more automated (set it once and forget about it).
![]() I prefer to use at for one-off type jobs, since the at-job is removed once it has executed. Whereas cron is better for continuous-type jobs (like the one you are asking about). |
![]() |
Tags |
bash, linux, script, shell, unix |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to modify the ls command? | bsdnewbie999 | OpenBSD General | 9 | 16th May 2009 08:20 AM |
djvu conversion (c44) command | gosha | Programming | 5 | 12th December 2008 03:04 AM |
avidemux2 command line | roddierod | FreeBSD General | 1 | 10th November 2008 08:27 PM |
pkg-get command not found | whispersGhost | Solaris | 2 | 11th June 2008 01:06 PM |
crypt command | whispersGhost | Solaris | 3 | 9th June 2008 05:37 AM |