nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28-01-2008, 07:53 PM
Junior Member
User
 
Join Date: Jan 2008
OS: fedora
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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; 28-01-2008 at 10:22 PM. Reason: Fixed typo and bad english
Reply With Quote
  #2 (permalink)  
Old 28-01-2008, 10:26 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 29-01-2008, 08:54 AM
Junior Member
User
 
Join Date: Jan 2008
OS: fedora
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 04:07 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38