This script helps you to backup important files of a Cryptpad instance. It uses SCP to transfer the files and compresses them into a .tar.gz
archive.
- Backup important Cryptpad files and configurations
- Compress the backup into a
.tar.gz
archive - Override default values by passing parameters
- Supports adding custom folders to sync
-
Update the
cryptpad_ip
variable in the script with the IP address of your Cryptpad instance. -
(Optional) Update other variables if needed, such as
ssh_username
,cryptpad_path
, and asset locations. -
Run the script with the following command:
./cryptpad_backup.sh
-i
: Override thecryptpad_ip
variable-c
: Override thecryptpad_path
variable-b
: Override thebackups_dir
variable-h
: Display the help page
To add a custom folder or file to sync with the script, create a new backup
function call at the end of the "BACKUP SCHEDULE" section, like this:
backup /path/to/your/custom/folder
Replace /path/to/your/custom/folder
with the path to the folder or file you want to sync.
The backup archive will be stored in the specified backups_dir
with the following format:
cryptpad_backup_<datetime>.tar.gz
A log file will also be created in the same directory, named .cryptpad_backup.log
.
If you encounter issues with constant SSH keyphrase requests, make sure to add your SSH key to the ssh-agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
Replace ~/.ssh/id_rsa with the path to your private SSH key if it's different.
Feel free to submit issues, pull requests, or suggestions to improve this script.