![]() |
|
#1
|
||||
|
||||
Create a batch file on linuxHow would I do that? Appreciate any examples you can offer...
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#2
|
||||
|
||||
|
Err...no such thing as "batch file" you'd have to use shell scripts, I'll see if I can dig up one of my old ones in a few minutes...what you need it for anyway? Maybe there's a better way...
Ok, found an old one, all it does is find empty files and put a header into them... #!/bin/bash for i in * do head --lines 1 <$i >/tmp/head.tmp mv /tmp/head.tmp $i done Last edited by Elmseeker : 13-Jan-2003 at 18:57.
|
|
#3
|
||||
|
||||
|
i want to run something every 24 hours...
So this 'shell script' it's in a file or something?? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
||||
|
||||
|
Yes it's in a file, I expected that's what you wanted!
Make a file in your directory called crontab, it should contain the following: 0 0 * * * /path/to/file/to/execute & This will run the file every 24 hours at midnight server time...to change the time simply change one of the first 2 numbers, first is minutes, second is hours, use 24 hour time format...the *'s are for day of the month, month and day of the week in that order so you could set it to run say...fridays at midnight 5 0 * * 5 $HOME/bin/daily.job >> $HOME/tmp/out 2>&1 Sunday is day 0 AND day 7 Enjoy! |
|
#5
|
||||
|
||||
|
Whoa there... first tell me about this file...
it's mysample.job or mysample.anything? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
||||
|
||||
|
Can be anything at all, lol, and I am psting too fast?!?! It said sorry can only post every 60 seconds and I had just posted a reply tosomething else lol...*is too fast for these boards* *cracks a whip over the boards* MUSH! Ya! MUSH!
|
|
#7
|
||||
|
||||
|
so now, if my website was hosted at:
Code:
Where would this CRONTAB dir have to be? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#8
|
||||
|
||||
|
the crontab file always goes in your $HOME directory aka /home/username
|
|
#9
|
||||
|
||||
|
Excellent, unfortunately I have to leave, so I will take this up with you later on. Thanks Elm.
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to boot Linux in text mode with GRUB Loader | JdS | Computer Software Forum - Linux | 8 | 11-Jul-2006 04:41 |
| Changing monitors on a Linux machine | JdS | Computer Software Forum - Linux | 10 | 23-Dec-2004 09:49 |
| How to create batch files without DOS box? | rhino1616 | Web Design Forum | 3 | 18-Aug-2003 10:00 |
| RESELLER Specials - Create your own Resellers 1GB disk space 10GB transfer $10/Month | IEAN.net | Web Hosting Advertisements & Offers | 0 | 19-May-2003 13:32 |
| How Do i get php to find out the file type of a file for me? | viperman95833 | MySQL / PHP Forum | 2 | 08-Mar-2003 09:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The