
This is a super simple way to backup your system without spending a penny. It can be really practical, as backup is always important.
Someone said "When your data does not exist 3 times, that means it's not exist at all". So made some backup and backup your backup 

Here we go:
#!/bin/date
echo "############### Backup of files on my server ###############"
backupfilename=server_backup_`date '+%Y-%m-%d'`
echo "----- Sql first and dumping current DB -----"
rm -f /tmp/backup.sql
mysqldump --user=youruser --password=yourpassword --all-databases --add-drop-table > /tmp/backup.sql
echo "----- Tar plus zip all files -----"
tar cvf /home/mybackups/files/${backupfilename}.tar /home/www/html/* /tmp/backup.sql
gzip /home/mybackups/files/${backupfilename}.tar
chmod 666 /home/mybackups/files/${backupfilename}.tar.gz
echo "############### Backup done successfully.... ###############"
date
***
Now let explain each line:
[[hook_it_sid]]
NOW let's Executing the Script
Name your file 'backup.sh'
To execute it you need to opne terminal prompt and start with a dot '.' so if you name your file backup.sh you will do .backup.sh
Now let's automate it because you probably don't want to do it manually everyday.
So if you want to auto run it everyday at 23h55 you will open your crontab with crontab -e and you will add this :
55 23 * * * /path/toyourfile/backup.sh >> /path/toyourlogfile/backups.log
and close your crontab terminal with :x
NOTE:
>> /path/toyourlogfile/mybackups.
If you want to set different time in your cron I recommend you to use this tool is super easy and it will do the job.
If you need any help with custom web development don't hesitate to contact our web developing agency. We have over a decade experience in web development and we are the best web agency in Montreal.
Read our articles for tips about Joomla Error, data leak orSSL/TLS.

Sidick Allalade, is Chief Technology Officer at Oshara INC and co-founder of the Osortoo web application. He loves solving complex IT problems, coding and everything IT. He has a good knowledge of online marketing and IT Governance, Audit and Security.
His experience spans hundreds of projects with companies of all sizes which makes him a valuable asset on any team.
Was this article useful?

Laravel is a powerful php framework that allows you to create custom web applications

By definition, a communication agency (marketing) is a company that plans and harmonizes internal and / or external communication on be...

Did you already try udpating your joomla website and you got this error : "An error has occurred. 0 Cannot open file for writing log" ...

Collecting data from customers is an important marketing strategy since it gives you information on what customers exactly want instead...

With the aim of helping companies improve their notoriety through their blogs. Oshara Inc, shares his knowledge about Netlinking in thi...

Like Twitter and Facebook, Instagram offers the possibility for administrators of an Instagram page to certify certain pages. Oshara In...
By registering, you agree to receive emails from Oshara.
By registering, you agree to receive emails from Oshara.