LCKB
[Shell] Backup system - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Release Zone (https://lckb.dev/forum/forumdisplay.php?fid=190)
+---- Forum: General Releases (https://lckb.dev/forum/forumdisplay.php?fid=127)
+----- Forum: General Server Releases (https://lckb.dev/forum/forumdisplay.php?fid=212)
+----- Thread: [Shell] Backup system (/showthread.php?tid=3767)

Pages: 1 2 3


- peter3301 - 07-06-2014


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




- GuX - 07-07-2014

Nice when you cannot leave navicat save all day Big Grin




- Paramount - 07-07-2014


Nice when you cannot leave navicat save all day Big Grin

Who on earth would leave navicat save all day? 




- Sutz - 07-07-2014


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

 

I just use putty lol

 

 

mysqldump u root newproject_db > newproject_db.sql




- GuX - 07-08-2014


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

 




- Paramount - 07-08-2014

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. 




- peter3301 - 07-08-2014


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).




- peter3301 - 08-28-2014


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]




- Black Sabbath RnR - 08-31-2014

nice)




- gurock1172 - 09-12-2014

thank you