Last active
June 16, 2022 17:38
-
-
Save sukhikh18/4ee6df1e5c4630e9f0a142982e071f8a to your computer and use it in GitHub Desktop.
Backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -uadmin --password="admin" --no-tablespaces tablename > ./site-`date '+%Y%m%d'`.sql \ | |
--ignore-table=DATABASE.table1 | |
mysqldump -uadmin --password="***" --no-tablespaces app | gzip > ./site-`date '+%Y%m%d'`.sql.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ./site-backup.sql | mysql -hdb -uroot -padmin tablename | |
gunzip -c ./site-backup.sql.gz | mysql -hdb -uroot -padmin tablename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -czvf ./site-`date '+%Y%m%d'`.tar.gz \ | |
--exclude '*bitrix/tmp/*' \ | |
--exclude '*bitrix/updates/*' \ | |
--exclude '*bitrix/backup/*' \ | |
--exclude '*bitrix/*cache/*' \ | |
--exclude '*bitrix/admin/strace/log*' \ | |
--exclude '*upload/*' \ | |
/var/www/sitename/current/ | |
tar -czvf ./site-`date '+%Y%m%d'`-upload.tar.gz /var/www/sitename/shared/upload/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment