[Shell] Backup system
#1

Hi,

here a little backup system.

You need to chance DIR1 or create a Dir. with the name dump in your home folder.

(if you use a Cronjob or a Sleep you can run this script in X time)

 

[hide]

#!/bin/sh

VAR=`date +"%Y-%m-%d_%T"`
DIR1=/home/dump

mkdir $DIR1/$VAR
mysqldump newproject_db > $DIR1/$VAR/newproject_db.sql
mysqldump newproject_db_auth > $DIR1/$VAR/newproject_db_auth.sql
mysqldump newproject_data > $DIR1/$VAR/newproject_data.sql
mysqldump newproject_db_user > $DIR1/$VAR/newproject_db_user.sql
mysqldump newproject_website > $DIR1/$VAR/newproject_website.sql
mysqldump newproject_post > $DIR1/$VAR/newproject_post.sql

clear

echo "done"
If you want to send your Backups to your dropbox account, use this : 2[/hide]

 

Salute,

peter

#2
Nice when you cannot leave navicat save all day Big Grin

#3

Nice when you cannot leave navicat save all day Big Grin

Who on earth would leave navicat save all day? 

#4

I think he means dumping with navicat.. takes a day lol

 

I just use putty lol

 

 

mysqldump u root newproject_db > newproject_db.sql

#5

Navicat is good and auto :d, just need to not shutdown computer (so if u down computer every day you cannot use navicat backup)

 

#6
Yes, probably it's good, but I'm sure it takes an year to export databases. I'd use back-up script on the server and then send the backup to dropbox. Imo it's the best variant. 

#7

Yes, probably it's good, but I'm sure it takes an year to export databases. I'd use back-up script on the server and then send the backup to dropbox. Imo it's the best variant. 

i send my backups to my second webspace but okey, if other guys use dropbox i hope this can help : 2

(i don't work with the Uploader).

#8

newest version

 

i release this first in my other thread (facepalm).

[hide]

#!/bin/sh

VAR=`date +"%Y-%m-%d_%T"`
DIR1=/home/dump
#insert your Database names here
AUTH=
USER=
DATA=
DB=
POST=
WEB=

#DONT EDIT BELOW!
mkdir $DIR1/$VAR
mysqldump $DB > $DIR1/$VAR/$DB.sql
mysqldump $AUTH > $DIR1/$VAR/$AUTH.sql
mysqldump $DATA > $DIR1/$VAR/$DATA.sql
mysqldump $USER > $DIR1/$VAR/$USER.sql
mysqldump $WEB > $DIR1/$VAR/$WEB.sql
mysqldump $POST > $DIR1/$VAR/$POST.sql

clear
echo "done"

[/hide]

#9
nice)

#10
thank you



Forum Jump:


Users browsing this thread: 1 Guest(s)