Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-30-2008, 01:33 PM   #1
Registered: Nov 2008
Location: وادی ھنزہ
Distribution: Solaris 5.10, Debian Server 5.2, CentOS 5.6
Posts: 226
Blog Entries: 3

Rep: Reputation: 38
How to run this script in Crontab

Am trying to run a script every minute which will run another script in it and the output of capsuled script will be appended to a file..

crontab -e

## Min Hour Day Month Week

    *    *   *    *     * ~/My_Scripts/

#! /bin/bash

sh ~/My_Scripts/ >> ~/Baiglog.log

#! /bin/bash


df -h | grep /dev/sda1 | awk '{print "Disk: Win C Drive    Size:" $2,"  Used:" $3,"     Available:",$4}'
df -h | grep /dev/sda5 | awk '{print "Disk: Win D Drive    Size:" $2,"  Used:" $3,"     Available:",$4}'
f -h |grep gvfs-fuse-daemon | awk '{print "Disk: Linux Drive    Size:"$2,"  Used:"$3,"    Available:",$4}'

My cornd service is running!!

Am trying to learn shell scripting these days...

Old 11-30-2008, 01:39 PM   #2
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,235

Rep: Reputation: 302Reputation: 302Reputation: 302Reputation: 302
Are you saying these scripts dont run? Try putting in full path to all scripts and executables because cron doesnt usually know environment and other variables like ~
Old 11-30-2008, 02:34 PM   #3
Registered: Nov 2008
Location: وادی ھنزہ
Distribution: Solaris 5.10, Debian Server 5.2, CentOS 5.6
Posts: 226
Blog Entries: 3

Original Poster
Rep: Reputation: 38
All right, that was "~"problem.. now am done.. its doing what I wanted..

Now second thing,

How to mail this log to my email address?

would I have to install any packages to get this done?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run crontab in shell script panselva Linux - General 3 05-08-2008 08:33 PM
script won't run in crontab(centos 5) ncsuapex Programming 2 03-09-2008 06:55 PM
Script run by crontab won't send email Braynid Linux - Newbie 1 12-21-2007 12:16 AM
Crontab -e doesnt run my script ! c0nsur Linux - General 4 08-03-2005 11:21 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 03:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration