đĻBackup your node
A good practice is to back up the entire node/.config/
folder, which contains the store folder, the node keys files, and some necessary files if you have to import the node to a different machine.
In 2.0 the store folder is the same for all nodes, so you can import it from another node in oder to quickly sync up a new node. To swap keys between machines, you only needs to swap the config.yml and keys.yml, and nothing else.
Personally, I do backup the entire node/.config/
folder, but I DO NOT back up my keys.yml and config.yml files with it, for security. Instead, I back up those files locally, since they just need to be backed up once (see Backup your private keys).
How to back up?
If you have set up your server with RAID 1, you are already backing up all your data on your second disk. Still, ensure your provider offers reliable support in case of need.
If you are using CherryServers, they already provide backup storage by default, and you can set up a cronjob to back up your store folder every hour (they will assist you if needed).
If you don't have many nodes, you could manually back up your store folder once a day.
There are also more sophisticated methods to create automatic backups on Linux, but you need to have expertise in this area.
If you have used the "Backup Node" option in the Q1 menu, read this
The current Q1 backup node option backs up your entire .config
folder, including your store folder, at your chosen time interval.
Drawbacks in Q2.0
Backing up while the node is running is not ideal. While it can work, it may cause issues when restoring a backup in some cases.
Backing up the store folder is less necessary than before, as the store is no longer unique to your node. You can now restore a store from a different node if needed.
Stopping Current Backup Process
If you're using the "node backup" feature and want to stop these backups from running while the node is active:
Access your crontabs by running:
Find and comment out or delete the line that begins with:
To save, press
CTRL+X
and thenY
Setting Up Safe Store Folder Backups
To keep a snapshot of your store folder while the node is stopped, you can add a cronjob like this:
Important Notes:
Replace
bucket/folder
with your StorJ bucket name and backup folder pathTest the command before setting up the cronjob
This will run daily at 5 AM. You can adjust the frequency, but remember that each run will stop and restart your node. The node will remain stopped during the upload to StorJ.
The command is set to NOT back up your keys.yml and config.yml, for security. Delete the command filters if you want to back them up.
Using the
sync
command means only new files are copied. After the initial backup, subsequent backups will be quick (approximately 1 minute).
Back up automatically on Storj
This script is outdated for Q2.0. Please read the paragraph above. While this script will still work, it's not optimized for 2.0, particularly because it performs backups while the node is running. This is no longer recommended as it can sometimes cause issues when restoring a backup.
I created a script to set up automatic backups on StorJ.
Before using the script, you need to create a bucket specific to Quilibrium and public/private keys to read/write in this specific bucket.
To create your Keys on StorJ click on "Access Keys" in your left menu, then choose "S3 Credentials", and select the various options you want (suggested: read/write on a specific bucket).
I like StorJ more than Amazon AWS, it is more user-friendly, cheaper, and in my opinion more secure.
The script allows you to also back up your cronjobs and any custom script that you have in the /root/scripts
folder
If you are ready, you can use the script by running this:
Follow the Safety checks before running this script in your server
Restore a backup hosted on StorJ
I also made another script to restore your backup. It will only work if you backed up your entire .config
folder via the script above.
I recommend you to install the Q1 - Node Quickstart Menu where you will find both options (Backup and Restore). Or you can run the restore script directly with this command:
Troubleshooting
If after running the script, your backups do not work, here are some things you can check.
Check your cronjobs with crontab -l
they should begin with rclone and have the source and target path set correctly. You can manually edit them with crontab -e
, but be careful.
Check the rclone configs, run nano ~/.config/rclone/rclone.conf.
They should look something like this:
If up until this point everything looks correct, you may want to check your StorJ account and see if you are using the correct keys to access the bucket that you have set in your cronjobs.
Backing up your whole .config folder
If you have run the previous version of the script (before 15.06.2024 13.30 UTC), your cronjob is set to back up only the store folder. Since it seems now better to back up the whole .config folder, here is what you can do.
Other backup scripts
Last updated