nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

BACKUP IN LINUX ?????

This is a discussion on BACKUP IN LINUX ????? within the Linux software forums, part of the Linux Getting Started category; well my linux box is configured to backup by Mondo Archieve. My problem is that i am not familiur with ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 08-10-2006, 07:06 AM
Junior Member
User
 
Join Date: Jul 2006
Posts: 15
Rep Power: 0
ishu
Default BACKUP IN LINUX ?????

well my linux box is configured to backup by Mondo Archieve.
My problem is that i am not familiur with linux so as Mondo, I am handling this box as additional stuff in my job. Recently my tape drive stops working due to some mechenical problem. Now we are not using tape drive anymore and there is no backup of my linux box which is really a ALARM for me. tell me what should i do now. how i check mondo configurations. can i store backup on Network path as i have a powerful server in my network with more then 100GB spare space on HDD. how i can do it. also i need to know which file should be backup i am running squid, intranet website, samba, gnokii on this linux box
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-10-2006, 06:14 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You can make backup using various commands. To make a full backup of entire system use dump command.

Each Sunday night full backup
Following command backups all user data stored in /home, /var/www is web root for web sites and /etc is configuration directory. I use tar command to backup all important directories:
Code:
tar  -zcvf /backup-22-04-2006.tar.gz /var/www /home /etc
Then I run ftp data and store it to NAS server.

Rest of weekdays I just make an incremental backup and than again ftp to NAS server:
Code:
tar -g /var/tar.inc.log  -zcvf /backup-23-04-2006.tar.gz /var/www /home /etc
I also dump mysql data using mysql dump command.

mysqldump -u madmin -h localhost -p mypassword db1 | gzip -9 > db1.gz

And I upload this backup to NAS using ftp

Backup arranged as follows:
Full-backup == Sunday backup
System-backup = everyday incremental backup for both MySQL and directories

Code:
drwxr-xr-x   5 ftpusers ftpusers      4096 Aug  6 00:14 full-backup
drwxr-xr-x  34 ftpusers ftpusers      4096 Aug 10 00:15 system-backup
If you goto full-backup you will see data arranged according to dates
Code:
drwxr-xr-x   2 ftpusers ftpusers      4096 Aug  6 00:15 06-08-2006
drwxr-xr-x   2 ftpusers ftpusers      4096 Jul 28 06:17 28-07-2006
drwxr-xr-x   2 ftpusers ftpusers      4096 Jul 30 00:19 30-07-2006
The entire procedure is automated using shell scripts. Chk out my two scripts:

MySQL backup -
http://bash.cyberciti.biz/backup/mysql-backup.bash.php

http://bash.cyberciti.biz/backup/mybackup.php

If you want i will upload the ftp automated backup script when i will get back to home

let me know...
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 08-11-2006, 04:36 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Chk out:
http://bash.cyberciti.biz/backup/wizard-ftp-script.php

as well .. http://www.cyberciti.biz/tips/how-to...matically.html

let me know if you need any help
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #4 (permalink)  
Old 08-15-2006, 05:44 AM
Junior Member
User
 
Join Date: Jul 2006
Posts: 15
Rep Power: 0
ishu
Default Backup

After digging into my linux box i found that mondo is already configured on my machine for backup. you can see in /var/local/sbin/mondoarchieve

Code:
echo "New archive made, setting path"
PATH=/usr/local/bin:$PATH
export PATH

echo "Path set, running mondo"
### run mondo
mondoarchive -Ot -d /dev/st0 -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"
echo "Mondo ran, emailing the logs"
### trim the log and email me the log file
tail -200 /var/log/mondo-archive.log > /tmp/mondo-archive.stripped
mail -s "Mondo Archive Report" me@mydomain.com.au < /tmp/mondo-archive.stripped
rm /tmp/mondo-archive.stripped
/usr/bin/eject /dev/st0
can you please make me understand what is script is doing?
Reply With Quote
  #5 (permalink)  
Old 08-15-2006, 05:02 PM
Junior Member
 
Join Date: Aug 2006
Posts: 2
Rep Power: 0
reynold
Default

Code:
echo "New archive made, setting path" 
PATH=/usr/local/bin:$PATH 
export PATH
Set up path

Code:
echo "Path set, running mondo" 
### run mondo 
mondoarchive -Ot -d /dev/st0 -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"
It will NOT backup dirs - /usr/pub /var/mdaemon /var/tars to tape device /dev/st0. In other words, it will backup whole system excpets those dirs specifed by -E option. It will also backup your boot loader GRUB and stored on /dev/hda hard disk.

Code:
echo "Mondo ran, emailing the logs" 
### trim the log and email me the log file 
tail -200 /var/log/mondo-archive.log > /tmp/mondo-archive.stripped 
mail -s "Mondo Archive Report" me@mydomain.com.au < /tmp/mondo-archive.stripped 
rm /tmp/mondo-archive.stripped
It will send an email to you along with mondo archive log.
Code:
/usr/bin/eject /dev/st0
It will eject /dev/st0 i.e. tape cartridge.
Reply With Quote
  #6 (permalink)  
Old 08-16-2006, 06:15 AM
Junior Member
User
 
Join Date: Jul 2006
Posts: 15
Rep Power: 0
ishu
Default Cron <root@intranet> /usr/local/sbin/mondo-smb 2>/d

In the mail i got this message?


New archive made, setting path
Path set, running mondo
Initializing...
See /var/log/mondo-archive.log for details of backup run. Checking sanity of your Linux distribution Done. Fatal error... output folder does not exist - please create it
---FATALERROR--- output folder does not exist - please create it Please try the snapshot (the version with 'cvs' and the date in its filename)to see if that fixes the problem. Please don't bother the mailing list withyour problem UNTIL you've tried the snapshot. The snapshot contains bugfixeswhich might help you. Go to http://www.mondorescue.org/download/download.htmlFor more information. Log file: /var/log/mondo-archive.log FYI, I have gzipped the log and saved it to /tmp/MA.log.gz Mondo has aborted. Execution run ended; result=254 Type 'less /var/log/mondo-archive.log' to see the output log Mondo ran, emailing the logs
Reply With Quote
  #7 (permalink)  
Old 08-16-2006, 01:49 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Can you type (paste here) the output of following command:

Code:
mondoarchive -Ot -d /dev/st0 -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"
Reply With Quote
  #8 (permalink)  
Old 08-19-2006, 06:43 PM
Member
User
 
Join Date: Jul 2005
Posts: 85
Rep Power: 0
ricc
Default

Quote:
Fatal error... output folder does not exist - please create it
I think you said that your tape drive has gone bad.

It is trying to access the tape drive /dev/st0. So, may be you can change the code

Code:
mondoarchive -Ot -d /dev/st0 -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"
to
Code:
mondoarchive -Ot -d /backup -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"

and then, as Vivek said, ftp the backup to another system or your NAS( if you have one)

ricc
Reply With Quote
  #9 (permalink)  
Old 08-20-2006, 12:16 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Err ricc, i did not noticed about her/his bad tape... anyways i think following command need to change -Ot means tape for directory you should use -Oi (ISO)

Replace
Code:
mondoarchive -Ot -d /backup -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars"
With:
Code:
mkdir /backup
mondoarchive -Oi -d /backup -T /tmp -F -l GRUB -f /dev/hda -E "/usr/pub /var/mdaemon /var/tars /backup"
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Need Help (Linux Backup) santoshkamane Linux software 2 04-29-2005 10:18 PM


All times are GMT +5.5. The time now is 08:34 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36