Solved

Automatic backup script & disk space Checking Script

Posted on 2003-11-17
6
626 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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