LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-06-2011, 04:30 AM   #1
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Rep: Reputation: Disabled
Custom backup newbie


Hi,
I am building a backups script and would like to know how to do the following:

1. count /home , /home2 and /home3 subdirectories size while checking load after each subdirectory and if load is higher than X.XX sleep for Y seconds.

2. Then Tar all folders to the specific directory and transfer to remote server, while checking the load also.

Could anyone suggest something?

hi,
How would I accomplish the following with bash script:
1. Take one (first) directory from the /home* (need to scan all home, home2, home3)
2. Check size
3. If size is bigger than X MB, add this dir name to somefile.txt ELSE tar this directory.
4. Move it to the specific folder
5. Use FTP to transfer it to remote server
6. Check server load
7. If load is higher than X.XX, sleep 30s, try again..
8. If load is lower than X.XX, go to step 1 and take second folder.

Would that be hard to accomplish?

Last edited by colucix; 09-06-2011 at 05:25 AM. Reason: Essentaily the same question.
 
Old 09-06-2011, 04:53 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Hi 2free,
Is this your homework? If not why do you want to do these things?
ciao,
jdk
 
Old 09-06-2011, 04:56 AM   #3
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
This is pretty much the same as you Bash with IF backup script help needed thread, correct?
jdk
 
Old 09-06-2011, 05:14 AM   #4
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
This is pretty much the same as you Bash with IF backup script help needed thread, correct?
jdk
Yes Im sorry, just wanted to explain more clearly.
 
Old 09-06-2011, 05:16 AM   #5
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
No it's not my homework. I need to build a custom backup script, as our company has many clients and cPanel backup overloads the server too much.
So the point is to create a custom script which would do the backups maybe a bit more slow, but without causing server load. Also, do not backup accounts bigger than X MB.

Would you be able to help or at give some advice?
 
Old 09-06-2011, 05:28 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
I've merged the two threads. @2freehosting: if you want to add clarification to an existing question, you might use the EDIT button inside the original post and add/change whatever you want.
 
Old 09-06-2011, 05:30 AM   #7
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by 2freehosting View Post
Would you be able to help or at give some advice?
Absolutely! How much are you offering?
But seriously, get yourself a good Bash Manual and then pepper the forums with questions as they come up.
ciao,
jdk
 
Old 09-06-2011, 05:39 AM   #8
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes, will need to check the manual, would you recommend any good one online?
 
Old 09-06-2011, 05:57 AM   #9
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Here are two: Bash Guide for Beginners by Machtelt Garrels and Learning the Bash Shell by Cameron Newham & Bill Rosenblatt. Is my cheque in the post?
ciao,
jdk
 
Old 09-06-2011, 06:00 AM   #10
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
Here are two: Bash Guide for Beginners by Machtelt Garrels and Learning the Bash Shell by Cameron Newham & Bill Rosenblatt. Is my cheque in the post?
ciao,
jdk
Thank you a lot!
 
Old 09-06-2011, 08:03 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Bash guides:
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

Other options:
Have you considered rsync: it only transmits differences, so load is lower after initial backup.
For multiple systems, consider amanda/zmanda http://www.zmanda.com/quick-backup-setup.html
 
Old 09-08-2011, 02:49 AM   #12
2freehosting
LQ Newbie
 
Registered: Sep 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thank you all for replies, appreciate the help.
 
  


Reply


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
Newbie trying to write a simple backup script to backup a single folder Nd for school stryker759a Linux - Newbie 2 09-16-2009 09:52 AM
Backup services status & custom kernel chessonly Linux - General 0 08-30-2006 02:19 PM
custom backup lionslair Linux - Software 2 04-07-2006 07:10 PM
Two newbie questions - Custom Fonts, and KDE Makaelin Slackware 5 09-01-2004 02:54 AM


All times are GMT -5. The time now is 10:19 AM.

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