Bash backup script -
I am trying to create a script for backup to my service provider, though it is empty tar archive and empty sql files And I do not know why. Can anyone see the problems here?
#! / Bin / bash SERVER_DIR = "/ var / www / vhosts / site.org" DATE = $ (date + "% d-% m-" $ (which mysqldump) "GZIP =" $ (gzip) "MKDIR =" BACKUP_DIR = "/ backup / $ DATE" NAME = "full- $ DATE" MYSQLUSER = "admin" MYSQLPASS = "pass" MYSQLDUMP = "$ (which mysqldump)" -p $ BACKUP_DIR tar -zcvf $ BACKUP_DIR / $ NAME.tar.gz $ SERVER_DIR $ MYSQLDUMP -u $ MYSQLUSER -p $ MYSQLPASS - All-Database | $ GGIP-9 & gt; $ BACKUP_DIR / $ NAME.sql Find / Backup / -MTM +31 -XAC RM-RF {} \
I think you just have to gzip line On -c is missing, try: $ MYSQLDUMP -u $ MYSQLUSER -p $ MYSQLPASS - All-D Tabes | $ Jijiaipi-C 9 & gt; $ BACKUP_DIR / $ NAME.sql.gz
Comments
Post a Comment