The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A Batch job to delete files from various directories guruparan18 Shell Programming and Scripting 3 05-10-2008 01:31 PM
Batch delete specific folder from user home directories nipodrom Shell Programming and Scripting 2 05-09-2008 03:22 AM
bash - batch script for extracting one file from multiple tar files kuliksco Shell Programming and Scripting 4 11-12-2007 11:34 PM
batch delete using find, files with # character tphyahoo UNIX for Dummies Questions & Answers 0 05-30-2006 09:05 AM
How can I delete files using a file that containt path and names? AlvaroD UNIX for Dummies Questions & Answers 2 09-25-2001 09:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-31-2004
Registered User
 

Join Date: Jan 2004
Posts: 2
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.
Reply With Quote
Forum Sponsor
  #2  
Old 01-31-2004
kduffin's Avatar
UN1X
 

Join Date: Nov 2003
Location: Virginia
Posts: 441
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
Reply With Quote
  #3  
Old 02-04-2004
Registered User
 

Join Date: Jan 2004
Posts: 2
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
Reply With Quote
  #4  
Old 02-04-2004
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
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
Reply With Quote
  #5  
Old 02-04-2004
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
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.
Reply With Quote
  #6  
Old 02-04-2004
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Wow, you have a good eye. I'll move it to the Windows forum.
Reply With Quote
  #7  
Old 02-04-2004
Registered User
 

Join Date: Dec 2003
Location: The O.C.
Posts: 35
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\*"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0