|Classes of Chouchen||Shikiryu PHP Backup Tool||docs/back-up-to-synology.md||Download|
Back up to a Synology NAS
Part 1. NAS
You'll need to create a special user which will have very restricted access to your NAS or a group with multiple users (if you need to separate different backup for example).
For that, go to your control panel and add a group, call it
Still in your control panel, go to
Now that we have our user(s), we'll need a place to put our backups. For that, we won't be using an existing folder, because rights are pretty tough to manage in
Still in the control panel, go to
Part 2. Shared server
2.1. Script installation
Alright, now, we have a user who can write files in a single crypted folder only by SFTP, without download access. Seems pretty secured.
Now, on the shared server, install this project. If possible not within the
To save periodically, you may have to do it yourself, but most shared server propose CRON job (more or less limited).
2.2.1. You can use CRON (yay)
Go to your hosting platform and configure it. All interfaces are different and I can't do a tutorial for all of them. Just now that, you need to create a .php file with this in it :
Your CRON job must activate this file on the period you want. And, that's it.
2.2.2. You can't use CRON (oh)
Then, the only solutions are:
- Do it yourself, without scripts. - Do it yourself with this script. You only need to put the same php file that you need with CRON but within the docroot in a URL known only by yourself. The scenario and this project files can stay outside the docroot.
Oops, your website has been hacked, you must be pretty scared for your personal files on your NAS! Don't worry. If you did everything right, the only thing hackers will have access to is the list of your backup files (but not their contents!)
Change your user's password on your NAS and problem solved (for your NAS ; I'm sorry for your website though)
Oh no, someone brute-forced my
Change your user password (to something REALLY difficult this time), delete those files (and install a AV?)
Oooooh nnoooo, someone accessed my regular NAS account! They have all my NAS and so, my backups too! I'm screwed, right? Yup. Pretty much screwed. I feel sorry for you but hey, at least, this is not because of this project :-)
You should have a better password for your regular user, a better security policy on your NAS (and Synology offers many options) AND a 2-step login (seriously, that's the best)