I have work on one Magento 2 project with lots of data ~10GB Database + ~1GB CODE + ~5GB Media.
And I want to set up it on my local server. So I want to compress the full project with a database.
I have tried to create a database backup with this command
# mysqldump -u magento2_user -p magento2_db > magento2_db-20201110.sql
It takes half-day ~6h to create DB backup and during this process, my sh connection was backed so I need to recreate the backup.
Now, I have the better command for tack backup.
website:
tar -czvf ~/multi_dump.tar.gz --exclude=var/cache --exclude=var/session --exclude=var/log --exclude=var/tmp --exclude=var/export --exclude=var/report --exclude=var/backups --exclude='media/import' --exclude=media/tmp --exclude=media/downloadable --exclude=media/catalog . && echo OK
database:
mysqldump --single-transaction --add-drop-table -h <host> -u <user> -p <db_name> | gzip > dump.sql.gz
It was a very lengthy and time-consuming task.
So, I am finding a way to create a database backup with the automatic process in the background.
and I am found Ctrl+Z
, bg
, jobs
. means add this process in the background. but when I disconnect my ssh and reconnect it then I can't found that process in the jobs
and bg
command.
and also I have tried to add this process in crontab -e
but I haven't access it.
So, Anyone has any better solution for this problem?
This is os detail.
ctrl+Z
but not work so I have cancel it by usingctrl+C
. – Bhavesh Prajapati Feb 12 '21 at 10:49tar
andmysqldump
processes are probably still running, and you can see them withps -ef | grep -e tar -e mysqldump
. – berndbausch Feb 12 '21 at 11:30