A lot of you guys who are using shared hosting services here may be looking for a reliable way to have personal backups of your files and databases, so I decided to publish the commands here for your convenience. You can use these to manually backup your files and databases after which you can download and preserve these backups. If you wish to automate it, you can prepare a shell script for it. Sample Tutorial on Shell Scripts: https://www.guru99.com/introduction-to- ... pting.html
File Backup Commands:
Code: Select all
tar -cvpzf DESTINATION SOURCE
In case you want to have a full backup from the root folder of your user, you can exclude the backup folder itself by running this instead:
Code: Select all
tar --exclude='/path/to/your/backup/folder' -cvpzf DESTINATION SOURCE
Code: Select all
mysqldump -u YOURusername --password=YOURpassword --databases YOURusername_YOURdatabase --no-tablespaces | gzip > /path/to/your/backup/folder/FILENAME.sql.gz
If you would rather not have your password saved within the command and prefer entering it manually every time, use this instead:
Code: Select all
mysqldump -u YOURusername -p --databases YOURusername_YOURdatabase --no-tablespaces | gzip > /path/to/your/backup/folder/FILENAME.sql.gz
Code: Select all
mysqldump -u YOURusername --password=YOURpassword --databases YOURusername_YOURdatabase1 YOURusername_YOURdatabase2 YOURusername_YOURdatabase3 --no-tablespaces | gzip > /path/to/your/backup/folder/FILENAME.sql.gz