![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| crone job implimentation | Ramesh Vellanki | Shell Programming and Scripting | 1 | 07-03-2008 12:33 AM |
| delete files older than 5 minutes in directory (recursively) | scarfake | Shell Programming and Scripting | 3 | 06-12-2008 10:10 PM |
| users who loged within 5 minutes | roshni | Shell Programming and Scripting | 3 | 07-04-2007 06:35 AM |
| get last 5 minutes' log from log file? | fedora | Shell Programming and Scripting | 5 | 07-19-2006 01:49 PM |
| Convert minutes to hours, minutes, seconds | Vozx | Shell Programming and Scripting | 1 | 12-08-2005 10:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Crone job to delete .txt every few minutes
How can I setup a cron job to delete a .txt file in a directory every 'x' minutes?
After the file is deleted, the poll script automatically builds the file again if it's not their. What would the code look like to do this? Any help and consideration is greatly appreciated. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
*/5 * * * * rm /home/someuser/tmp.txt should rm the file every 5 minutes.
I am very new to this, so get a second opinion before listening to anything that falls out of my face, I've been known to be WAY off. |
|
#3
|
||||
|
||||
|
you can also use
0-59/5 * * * * rm /home/someuser/tmp.txt or 5 10 15 20 25 30 35 40 45 50 55 * * * * rm /home/someuser/tmp.txt (i had to learn this by force on an old AIX :P ) |
||||
| Google The UNIX and Linux Forums |