The server which I have hosted my blog is not a reliable one and due to its ‘cheap’ nature it comes with no features such as backup. After a dozen of unpredicted downtime and agony, I have wrote a small bash script to use with cron jobs until I find an economic, but quality hosting. Additionally I turn off MySQL daemon so that any database read/write operation will not get ignored by tar.
Find the quick backup script I am using in this website:
#Purpose = Backup of html folder
#Created on 10-02-2017
#Author = Praveen Nair
echo Stopping mysqld...
systemctl stop mysqld
echo creating tar.gz...
tar -cpzf /root/Dropbox/backup.tar.gz /usr/share/nginx/html /var/lib/mysql
echo Starting mysqld...
systemctl start mysqld
lftp -e "set ftp:ssl-allow no; mirror -R ~/Dropbox/ /backup/ ;quit" -u ftpuser,ftppass host_or_ip