Results 1 to 5 of 5
I am looking to create a shell script that utilises the traceroute command
i need it to output the data to a text file, so that i can use it ...
- 03-07-2008 #1
Creating a shell script
I am looking to create a shell script that utilises the traceroute command
i need it to output the data to a text file, so that i can use it to take statistics from.
i also need the file to run 3 times a day for about 7 days.
Can anyone advise me on how to go about this? or how to code it?
thanks.
- 03-07-2008 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
You can redirect your output within your script to your logfile:
or redirect the output in your crontab file like:Code:echo "Message ..." >> /directory/logfile
This is an example of a cron job that runs once a day at 4:30a.Code:30 4 * * * /mydir/my_script.sh >> /directory/logfile
You can find a bunch of examples on the net to set up a cron job if you Google on "crontab tutorial".
Regards
- 03-07-2008 #3
so then i would put that cron code in a shell script?
how would i make a shell script, and how would the compute know to run this script if the cron code was put inside it?
- 03-07-2008 #4
i have tried
but i get an error saying bash: 07: command not foundCode:07 22 * * 1-7 echo "Message/.........." >> /home/directory/test
- 03-08-2008 #5


Reply With Quote