SRCDS Steam group


Timed events
#1
i would like to know if there is any way of making linux execute a few commands say once every hour?

i know theres a file called crontab in etc but if i edit it to have this on the bottom (and i know the sh file does what i want to properly) will it run it once every 2 mins ?

im running freeBSD

*/2 * * * * /home/iamacup/srcds/sourceforts/cfg/banupdate.sh
Reply
#2
Yeah, use cron. I am pretty sure this will be the same in FreeBSD. Use

Code:
crontab -e

and pray you listed to all that advice you heard about learning vi because it would come in useful one day... ;-)
Reply
#3
right well the cron job works but my script doesent work with it

i wrote

cd /home/iamacup/srcds/sourceforts/cfg/
rm ./banned_user.cfg
wget http://www.the-unknown.org/bans/banned_user.php
mv ./banned_user.php ./banned_user.cfg

which works if you run it like ./banupdate.sh but in the mail from cron i get

rm: ./banned_user.cfg: No such file or directory
wget: not found
mv: rename ./banned_user.php to ./banned_user.cfg: No such file or directory


how would i make it do the set of 4 commands i want, its triping up on wget?
Reply
#4
OK, I have my cron scripts in my user dir, don't know whether that makes a difference. If its giving you problems with the path, don't bother cd'ing to the dir, just use the full paths in your script. The most likley reason wget is failing is also because you haven't referenced the full path. Use

Code:
whereis wget

To find out where it is and then use (for example)

Code:
/usr/bin/wget

and it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)