There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios boot browser bsod computer cpu crash css dell desktop driver dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware help please hijackthis hjt install internet internet explorer itunes javascript keyboard lan laptop malware monitor network networking openoffice outlook outlook 2003 outlook express password popups problem router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless word youtube
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Schedule a batch file.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
indom's Avatar
Junior Member with 5 posts.
 
Join Date: Feb 2004
04-Feb-2004, 04:51 AM #1
Schedule a batch file.
Hi,

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

echo off
REM Batch file for removing the REPT files from the specified directory

rm -rf C:\\DDRIVE\\RD\\newfolder\\temp\\*
cd \
pwd

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 this to meet the requirement of deleting files at every 13th minute daily. Iam failing in using the AT command. Guess the syntax am giving is wrong. we work on winnt.

Thanks,
Indom
Squashman's Avatar
Distinguished Member with 12,296 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
04-Feb-2004, 10:32 AM #2
I am kind of baffled at the commands you are using. rm -rf would be a linux command as well as the pwd.

And c:\ would be a Windows Partition.

What exactly are you trying to do.
indom's Avatar
Junior Member with 5 posts.
 
Join Date: Feb 2004
05-Feb-2004, 12:40 AM #3
we are using windows Nt. Need to schedule a batch job that deletes files every 13 mins daily.
don't have much of handson on these OS commands. no wonder i mixed the commands.

pls help me with the code and scheduling syntax

thanks.
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
05-Feb-2004, 05:29 PM #4
I suspect you are using the MKS Utilities (or similar product) for NT -- these utilities provide Unix/Linux commands and functionality in an NT environment. If that's true, you might have a look at the "at" command or the "crontab" command. On the assumption that you are using the MKS product, you will need a crontab entry such as:

13,26,39,52 * * * * /name-of-your-command > /path-to-logfile 2>&1

Note that this command will run name-of-your-command at 13, 26, 39 and 52 minutes past each hour (24 x 7). This is not the same thing as running the command every 13 minutes.

I suspect you don't really mean to execute this command every 13 minutes. Instead, you may need to execute the command 13 minutes after any data arrives. However, if you really want to execute the command every 13 minutes, consider putting the timing logic in the script that does the deletion, so that the script wakes up every 13 minutes and deletes whatever it finds in the specified directory. You will need a loop and the sleep command to accomplish this. Be forewarned, however: your script will not be synchronized with data arriving, so it's entirely possible that your script could wake up and begin deleting data as it arrives, possibly even before it has been processed.

Hope this helps -- additional info appreciated.
__________________
The slowest component still sits at the keyboard.
indom's Avatar
Junior Member with 5 posts.
 
Join Date: Feb 2004
06-Feb-2004, 01:47 AM #5
Thanks a lot for your explanation.
Yeah running at 13,16,39 and 52 wud be better than going for every 13 mins.
Our clients want to run on winNT only. Though we have MKS, when i give crontab -l, it is giving "'crontab' is not recognized as an internal or external command, operable program or batch file."

While working with AT command am able to schedule it to run daily but unable to schedule it at 13,16,39,52 mins of hr daily.

In winnt i didn't find scheduler also like we have in win2k.
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
08-Feb-2004, 04:57 AM #6
Apologies for suggesting a crontab solution. Since I don't run NT (and have not kept up with recent MKS releases), I wasn't sure what options might be available to you (although I believe recent MKS versions included crontab functionality for NT). Unfortunately, the at command is a more limited form of the crontab command, and typically doesn't offer the flexibility/functionality of crontab. If you must use only native NT commands, I won't be much help, being largely ignorant of the NT world (sorry).
__________________
The slowest component still sits at the keyboard.
vinod.bhanur's Avatar
Computer Specs
Junior Member with 9 posts.
 
Join Date: May 2008
Experience: Beginner
04-May-2008, 07:59 AM #7
hello friends. this is vinod.
my problem is , i want to execute batch file after every 15 min

how can i achieve this task plz suggest .
vinod.bhanur's Avatar
Computer Specs
Junior Member with 9 posts.
 
Join Date: May 2008
Experience: Beginner
04-May-2008, 07:59 AM #8
hello friends. this is vinod.
my problem is , i want to execute batch file after every 15 min in windows

how can i achieve this task plz suggest .
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,538 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
04-May-2008, 03:35 PM #9
Posted to other thread
Reply


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

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:15 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.