Solved

Automatic backup script & disk space Checking Script

Posted on 2003-11-17
6
627 Views
Last Modified: 2011-10-03
Hi,
i am a new user to linux......

i want to implement the following two actions in my server.

1)execute one script which will take backup of "/home/abc" to "/dev/fd0" automatically at a perticular time .

2)execute one script which will keep on monitoring the disk space used in /home partition and if the disk space used reaches 90% it should send a message to webmaster@abc.com regarding this.

if anybody has the above scripts available plz provide me.....

my mail id : deepak@indiadomain.com

Thanks/Regards
Deepak Jena
0
Comment
Question by:deepakjena_2003
  • 3
  • 3
6 Comments
 
LVL 18

Accepted Solution

by:
liddler earned 50 total points
ID: 9763333
Deepak Jena,
Use cron to schedule your tasks, to edit your crontab, type:
crontab -e
to make a copy of the files in /home/abc to /dev/fd0, the command is
cp -r /home/abc /dev/fd0
so to run it each day at 9:00am
your  crontab entry should be:
0 9 * * *  /bin/cp -r /home/abc /dev/fd0

disksize command
 if [[ `df -k /var| grep var |awk '{print $5}' |cut -d% -f1` -gt "90" ]];then /usr/bin/mailx -s Diskfull  webmaster@abc.com ;fi

you can run this from cron as above (say evey 15 minutes)
0,15,30,45 * * * * if [[ `df -k /var| grep var |awk '{print $5}' |cut -d% -f1` -gt "90" ]];then /usr/bin/mailx -s Diskfull  webmaster@abc.com ;fi

PS Please do not put your email address in Questions



0
 

Author Comment

by:deepakjena_2003
ID: 9763477
Thanks a lot...

0
 

Author Comment

by:deepakjena_2003
ID: 9769881
please delete this question...

Thanks/Regards
Deepak Jena
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 18

Expert Comment

by:liddler
ID: 9769944
Deepak Jena,
The question doesn't get delete, it is stored in a database of Previously Asked Questions (PAQs) that other people can search.
0
 

Author Comment

by:deepakjena_2003
ID: 9769962
Hi,

can i use the above points..

bcz i have only 30 points available (50 for this question and 50 for another which is still open)

Thanks/Regards
Deepak
0
 
LVL 18

Expert Comment

by:liddler
ID: 9769986
No,
As the qustion has been answered your points have gone.
Have you done the new member survey (http://www.experts-exchange.com/survey.jsp?sid=2), for 200 extra points?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question