nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Shell Script to Automatically Delete a File via Cron Job

This is a discussion on Shell Script to Automatically Delete a File via Cron Job within the Shell scripting forums, part of the Development/Scripting category; Hi Friends, This is gowtham,i am facing one problem for the past two days,i.e i want delete the files from ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-28-2008, 07:53 PM
Junior Member
User
 
Join Date: Jan 2008
My distro: fedora
Posts: 2
Rep Power: 0
kakarla is on a distinguished road
Default Shell Script to Automatically Delete a File via Cron Job

Hi Friends,

This is gowtham,i am facing one problem for the past two days,i.e i want delete the files from folder for every one min,can any body help me what is the path for deletion of that folder. I am facing this problem with Redhat Linux 5.0. I am thinking that I need a script.

Thank you.

Last edited by root; 01-28-2008 at 10:22 PM. Reason: Fixed typo and bad english
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-28-2008, 10:26 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 578
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

You need to use cron job
Code:
* * * * * /bin/rm /path/to/folder/*
See CronJob
How do I add jobs to cron under Linux or UNIX oses?
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 01-29-2008, 08:54 AM
Junior Member
User
 
Join Date: Jan 2008
My distro: fedora
Posts: 2
Rep Power: 0
kakarla is on a distinguished road
Default

Quote:
Originally Posted by rockdalinux View Post
You need to use cron job
Code:
* * * * * /bin/rm /path/to/folder/*
See CronJob
How do I add jobs to cron under Linux or UNIX oses?


thank u my frnd
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Tomcat shell script cron job to restart server kasimani Shell scripting 4 05-03-2008 07:46 PM
Shell script to kill process Automatically after 3 days darknet Shell scripting 3 12-21-2007 10:46 PM
shell script for ftp the file vishal_titre Shell scripting 3 12-10-2007 08:40 AM
Shell script to delete a file with a dialog utility shankar100 Shell scripting 4 03-02-2007 10:22 AM
error shell script no such file or directory /bin/sh Linux software 1 01-08-2006 08:34 PM


All times are GMT +5.5. The time now is 04:39 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36