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:
Web development - We are a team of passionate web coders that will materialize your ideas in ways you could not even imagine.
API Integration - There is no secret using any API, connect all the tools you need, the way you need it.
IT And Cybersecurity Audit - Protect your customers, protect your business and protect yourself.
Maintenance & Support - We help organization to increase efficiency, improve performance, minimize downtime, and extend their lifespan.
Book a CallNOW 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 or SSL/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...
Collecting data from customers is an important marketing strategy since it gives you information on what customers exactly want instead...
Did you already try udpating your joomla website and you got this error : "An error has occurred. 0 Cannot open file for writing log" ...
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...