Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th December 2006, 09:55
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Exclamation rsync incremental snapshot backups

I followed your incremental snapshot backups.Nearly everything ok apart from some errors i wanted you to look at .
1 error message:
Quote:
/backup/backup.sh: line 2: -localhost: No such file or directory
/usr/bin/mysqldump: Got error: 1049: Unknown database 'Database' when selecting the database
The dir i want to backup is /var/www/torgab documentroot of my site and its relative database.The script i'm using is copied and pasted from the one here.
2 error message
Quote:
rsync error: some files could not be transferred (code 23) at main.c(789)
no support for smartcards.
/bin/touch: cannot touch `12682BACKUPDIR/current': No such file or directory
And you script has this double $$ , $$BACKUPDIR/current" is this incorrect ???
I corrected something including some others dirs in the esclude list i will wait for next messages and see how things are going.
__________________
http://www.gabrix.ath.cx
Reply With Quote
Sponsored Links
  #2  
Old 9th December 2006, 11:33
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default

Can you post me the script you have?
Or rather your modifications?
Reply With Quote
  #3  
Old 9th December 2006, 14:18
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

Quote:
Originally Posted by sjau
Can you post me the script you have?
Or rather your modifications?
The script is on this site , modifications are relative to my lan ips and paths mysql user e password.The script is basically the same you see on this site here http://www.howtoforge.org/rsync_incr...apshot_backups i have changed the last command
Quote:
$SSH -i $KEY $BACKUP_USER "$CP -al $BACKUPDIR/current/* $MKDIR"
where you see $BACKUPDIR/current/ there was a double $$ and that's it.
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #4  
Old 9th December 2006, 18:20
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default

Well, the double $$ is an error, I need to fix that... however I need what you have a script to see where the error lies that you are describing.
Reply With Quote
  #5  
Old 9th December 2006, 18:45
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

This is the last official error message after corrections:
Quote:
/backup/backup.sh: line 2: -localhost: No such file or directory
/usr/bin/mysqldump: Got error: 1049: Unknown database 'Database' when selecting the database
building file list ... done
deleting var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_d67744f1bde 873eb54ce60994b17c325
./
backup/
backup/backup.sh
backup/backup.sh~
backup/backup_exclude
backup/backup_exclude~
mysql_backup/
mysql_backup/Database.sql
mysql_backup/mysql.sql
mysql_backup/test.sql
mysql_backup/tor-final.sql
mysql_backup/tor-onion.sql
var/

sent 468194 bytes received 8462 bytes 56077.18 bytes/sec
total size is 16835570 speedup is 35.32
no support for smartcards.
This is the script i'm using as you see it doesn't differ much from the one here:
Quote:
#!/bin/bash
unset PATH
# USER VARIABLES
BACKUPDIR=/backup # Folder on the backup server
KEY=/root/.ssh/id_dsa
MYSQLUSER=xxxxx
MYSQLPWD=yyyyyy
MYSQLHOST=localhost
MYSQLBACKUPDIR=/mysql_backup
BACKUP_USER=xxxxxx@www
EXCLUDES=/backup/backup_exclude # File containing exludes
# PATH VARIABLES
CP=/bin/cp;
MK=/bin/mkdir;
SSH=/usr/bin/ssh;
DATE=/bin/date;
RM=/bin/rm;
GREP=/bin/grep;
MYSQL=/usr/bin/mysql;
MYSQLDUMP=/usr/bin/mysqldump;
RSYNC=/usr/bin/rsync;
TOUCH=/bin/touch;
## ##
## -- DO NOT EDIT BELOW THIS HERE -- ##
## ##
# CREATING CURRENT DATE / TIME
NOW=`$DATE '+%Y-%m'-%d_%H:%M`
MKDIR=$BACKUPDIR/$NOW/
# CREATE MYSQL BACKUP
# Remove existing backup dir
$RM -Rf $MYSQLBACKUPDIR
# Create new backup dir
$MK $MYSQLBACKUPDIR
#Dump new files
for i in $(echo 'SHOW DATABASES;' | $MYSQL -u$MYSQLUSER -p$MYSQLPWD
-$MYSQLHOST|$GREP -v '^Database$'); do
$MYSQLDUMP \
-u$MYSQLUSER -p$MYSQLPWD -h$MYSQLHOST \
-Q -c -C --add-drop-table --add-locks --quick --lock-tables \
$i > $MYSQLBACKUPDIR/$i.sql;
done;
# CREATE NEW BACKUPDIR
$SSH -i $KEY $BACKUP_USER "$MK $MKDIR"
# RUN RSYNC INTO CURRENT
$RSYNC \
-apvz --delete --delete-excluded \
--exclude-from="$EXCLUDES" \
-e "$SSH -i $KEY" \
/ $BACKUP_USER:/$BACKUPDIR/current ;
# UPDATE THE MTIME TO REFELCT THE SNAPSHOT TIME
$SSH -I $KEY $BACKUP_USER "$TOUCH $BACKUPDIR/current"
# MAKE HARDLINK COPY
$SSH -i $KEY $BACKUP_USER "$CP -al $BACKUPDIR/current/* $MKDIR"
__________________
http://www.gabrix.ath.cx

Last edited by gabrix; 9th December 2006 at 18:47.
Reply With Quote
  #6  
Old 9th December 2006, 19:49
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default

what's in your backup_exclude file?
Reply With Quote
  #7  
Old 10th December 2006, 10:18
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

esclude dir list:
Quote:
/bin/
/boot/
/dev/
/etc/
/home/
/lib/
/lost+found/
/media/
/mnt/
/opt/
/proc/
/root/
/sbin/
/srv/
/sys/
/tmp/
/usr/
/var/backups/
/var/cache/
/var/lib/
/var/local/
/var/lock/
/var/lost+found/
/var/mail/
/var/opt/
/var/run/
/var/log/
/var/spool/
/var/tmp/
/var/lib/php4/
/var/lib/mysql/
/var/ossec
/NFS
Last error messages:
Quote:
/backup/backup.sh: line 2: -localhost: No such file or directory
/usr/bin/mysqldump: Got error: 1049: Unknown database 'Database' when selecting the database
building file list ... done
This is fine i think it is just relative to a default database ... i think!But the message continues:
Quote:
./
mysql_backup/
mysql_backup/Database.sql
mysql_backup/mysql.sql
mysql_backup/test.sql
mysql_backup/tor-final.sql
mysql_backup/tor-onion.sql
var/www/torgab/cache/
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_1564112e05a 3c5d9d96ec38529658052
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_199acb87f60 fafc694a19f7267e685af
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_2417bf38466 50656d160848c3de73c07
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_2457334b781 0696f519c949ac4052c26
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_261d1cbd472 067bfd6a5aed9641607c4
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_3f63dae5fa6 ab5a80e6eedffe6b60608
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_470fd8071cc b77c1ba909801d4a2c48d
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_514561b6f0f ee94f6a616b8d26ef1bbe
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5253285a1b5 e1944d80f51e64967e54c
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5dcd4f10f51 1b30d0a62b4890c737256
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5e53b818ef6 600446c864c42376db053
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5f569ab862c 711112a65f1f56c6289b6
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_68777f4bf27 c7c9ff2c3e93cb6e6b041
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_6b35a744fd7 3826088873344ac8080a7
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_6f4c295ee7f 6e1f3c2cb900903495536
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_7c273fb8305 7c7b53866c10b8b7b9538
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_81b8f668c4f 6515dd62eeb4495029fe0
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_8292c094b7d be16b29659eb2fd07397a
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_856a929277e e107537ab95f0d36bf850
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_8f699a8ced6 609779f3bb51ed1c516a3
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_95931b4cf84 fff28696fe6e2f9cea5de
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_9b9542c4d82 832e5ea852eb542b12135
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_a3fc996e726 e90bdd69cb46520e146b7
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_a6602f9172a 36a6980d74d4ed8d354a0
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_b3cfa6c0c6b 4fc4c776e6c438beb0d55
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_b665b0365de 0a34f49f792fd996cf5df
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_b9ee24c4000 ceed09b9b83fb0cbfd527
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_bb4e28bc5ad b92caabb5f23c6371cf4c
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_c871fa09019 c8321bb033abc624b1b4b
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_d826f17eac0 82825c3a07fe85c9b45d4
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_db37c32731d ba66cb99c24a455e95f20
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_dba4df1e302 e075943c9884a4bba9839
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_de78affdc22 5806d708701f9ad8d824e
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e2a0feb7818 d84f63c7af528cdadb388
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e39d80a4899 10ebed4b74aa0837a3e23
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e54469a5510 146e973b3c0f3614cba03
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e615554d583 dc5577a3e86ab6975f821
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e6f2f5780ca e75e92f21ebaae69f8b9e
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e7a82d4bb1e d63aaed35b9358148d8cf
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_f25af5d0a6e 6813601aaedd03a9c6306
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_fc118868017 3cfd74a56ed14f2fa69f0

sent 106536 bytes received 4272 bytes 44323.20 bytes/sec
total size is 16873488 speedup is 152.28
no support for smartcards.
And i don't see anything to worry about .... great tutorial anyway !!!
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #8  
Old 10th December 2006, 14:48
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default

MYSQL is installed as you have backups of other sql-dbs...
This is an interesting entry... can you check whether you have a folder "Database" in your mysql folder?

And I think you should add
/backup/
also to the exlude file
Reply With Quote
  #9  
Old 11th December 2006, 11:58
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

The backup script stopped working i get this erro now ...
Quote:
/backup/backup.sh: line 2: -localhost: No such file or directory
Enter password: /usr/bin/mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: NO) when trying to connect
Enter password: /usr/bin/mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: NO) when trying to connect
Enter password: /usr/bin/mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: NO) when trying to connect
Enter password: /usr/bin/mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: NO) when trying to connect
Enter password: /usr/bin/mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: NO) when trying to connect
building file list ... done
./
backup/
backup/backup.sh
backup/backup.sh~
mysql_backup/
mysql_backup/Database.sql
mysql_backup/mysql.sql
mysql_backup/test.sql
mysql_backup/tor-final.sql
mysql_backup/tor-onion.sql
var/www/torgab/cache/
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_09dd40aebdf 73234a793ef10f446207c
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5606c17b001 b8023d35f97acbbe1d0a6
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_5685f11bfc8 65574bb4ce76818f01643
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_72bd4188da4 1ac60d92296eed2ef2c62
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_7c273fb8305 7c7b53866c10b8b7b9538
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_7d49c3bd946 c80583933661be3ebdd23
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_8cf353e8bca e4bc2114654198ad6652b
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_8d1c19102f5 e7397e001e4a836220fd2
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_94cbfbc785b ae17898ab89c086fc323e
var/www/torgab/cache/cache_94afbfb2f291e0bf253fcf222e9d238e_e6405e44bf6 38694b515d4da833cdaeb

sent 95612 bytes received 3646 bytes 39703.20 bytes/sec
total size is 16483462 speedup is 166.07
no support for smartcards.
I haven't changed passwords in mysql or anything,i don't have Database,actually i have nothing backed up !!!
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #10  
Old 11th December 2006, 12:03
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
 
Default

Well, the mysql-root account should have a password...
If you don't use MySQL at all then eliminate the following lines:

Quote:
# Create new backup dir
$MK $MYSQLBACKUPDIR
#Dump new files
for i in $(echo 'SHOW DATABASES;' | $MYSQL -u$MYSQLUSER -p$MYSQLPWD
-$MYSQLHOST|$GREP -v '^Database$'); do
$MYSQLDUMP \
-u$MYSQLUSER -p$MYSQLPWD -h$MYSQLHOST \
-Q -c -C --add-drop-table --add-locks --quick --lock-tables \
$i > $MYSQLBACKUPDIR/$i.sql;
done;
Otherwise you must set the root-mysql password...
Reply With Quote
Reply

Bookmarks

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 18:17
Incremental Backup chrno Installation/Configuration 2 17th May 2006 13:10
Quick rsync question iamcam Server Operation 1 23rd February 2006 00:22
Backups. Full and differential maxx General 3 12th January 2006 13:50
ISPConfig Backups SleeperZ Feature Requests 0 9th November 2005 10:36


All times are GMT +2. The time now is 04:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.