Schedule a Batch file to delete files at particular intervals | Unix Linux Forums | Windows & DOS: Issues & Discussions

  Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

Schedule a Batch file to delete files at particular intervals

Windows & DOS: Issues & Discussions


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-31-2004
Indom Indom is offline
Registered User
 
Join Date: Jan 2004
Last Activity: 4 February 2004, 5:43 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Schedule a Batch file to delete files at particular intervals

Hi,

I need to write a batch file/shell script that runs at specified intervals daily and deletes specified set of files.

Can anyone pls help me with the code.

Thanks,
Indom.
Sponsored Links
    #2  
Old 01-31-2004
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
 
Join Date: Nov 2003
Last Activity: 21 January 2014, 4:03 PM EST
Location: Belize
Posts: 484
Thanks: 0
Thanked 3 Times in 2 Posts
Please read the forum rules. You should perform searches before asking questions (this question having been answered several times). You should also post to the correct forum. This isn't an "advanced" topic.

Deleting files over 7 days old

Cheers,

Keith
Sponsored Links
    #3  
Old 02-04-2004
Indom Indom is offline
Registered User
 
Join Date: Jan 2004
Last Activity: 4 February 2004, 5:43 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Schedule batch job

Hi,

This is the batch file I have created to delete files.

echo off
rm -rf C:\\DDRIVE\\RD\\newfolder\\temp\\*
echo All The files have been deleted

For every 15 minutes we get the data and it should be deleted at the 13th minute.
can anyone pls tell me how to schedule to every 13th min daily.
Unable to get the syntax right for AT command.


Thanks,
Indom
    #4  
Old 02-04-2004
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
 
Join Date: Aug 2002
Last Activity: 3 October 2004, 6:07 PM EDT
Location: Cleveland, OH
Posts: 804
Thanks: 0
Thanked 5 Times in 4 Posts
Sounds like you'll want to set up a cron job. Read through this site and see if it'll work for you:

http://www.webmasters-central.com/t/cron.shtml
Sponsored Links
    #5  
Old 02-04-2004
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
 
Join Date: May 2001
Last Activity: 24 March 2008, 9:43 PM EDT
Location: Chicago IL, USA
Posts: 1,006
Thanks: 0
Thanked 2 Times in 1 Post
the fact your useing a "C:\" drive says you are trying to do this on a windows machine.

you will have to find a schedular for windows. i think win XP comes with one by default.

but reguardless you asked the question in the wrong forum.
Sponsored Links
    #6  
Old 02-04-2004
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
 
Join Date: Aug 2002
Last Activity: 3 October 2004, 6:07 PM EDT
Location: Cleveland, OH
Posts: 804
Thanks: 0
Thanked 5 Times in 4 Posts
Wow, you have a good eye. I'll move it to the Windows forum.
Sponsored Links
    #7  
Old 02-04-2004
viRaven viRaven is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 8 September 2011, 2:51 PM EDT
Location: The O.C.
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure on the syntax, check your help on the machine your using the at command. Don't know what your running on, but you seemed to be mixing the two OS commands.

try windows "at" command:

Local Machine
at 13:30 cmd /c "del C:\DDRIVE\RD\newfolder\temp\*"

Really need to read the help pages. If its on a remote computer then you need to designate that after "at"

at \\somecomputer 13:30 cmd /c "del c:\DDRIVE\RD\newfolder\temp\*"
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing a batch of files within a shell script with option to refire the individual files in batch goddevil Shell Programming and Scripting 2 01-09-2012 02:51 PM
Batch file to Get New Files Only through FTP alsharq Windows & DOS: Issues & Discussions 1 04-03-2009 05:13 PM
Batch file to Get New Files Only through FTP alsharq Windows & DOS: Issues & Discussions 1 03-29-2009 01:08 PM
A Batch job to delete files from various directories guruparan18 Shell Programming and Scripting 3 05-10-2008 04:31 PM
batch delete using find, files with # character tphyahoo UNIX for Dummies Questions & Answers 0 05-30-2006 12:05 PM



All times are GMT -4. The time now is 12:30 PM.