Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 2.1 KB

File metadata and controls

75 lines (46 loc) · 2.1 KB

pdsync

personal data sync script. Script that backups folder on an external hard drive and also upload them to S3. By default all the logs go to the /tmpfolder.

usage

pdsync.sh -d /backup /home/user/folder1 /home/user/folder2
pdsync.sh -d "/media/backups" -s s3://my-backups /home/user1/Videos /home/user1/Documents /home/user1/Pictures /home/user1/projects
pdsync.sh -d "/media/backups" -s s3://my-backups -f -t /home/user1/transition_folder /home/user1/Videos /home/user1/Documents /home/user1/Pictures /home/user1/projects

On crons define the XDG_RUNTIME_DIR so the cron can send the notification

* * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) pdsync.sh -d "/remote/backup" -p 5  -s s3://my-backups /home

gpg encryption

pdsync use gpg encryption, so this is a basic way to encrypt/decrypt files

encrypt

gpg --encrypt --sign --armor -r <email> --passphrase-file <passphrase_file> -o <destination> file_name

decrypt

gpg file_name.asc

Some documentation about gpg

gpg Export and Import

Export public key

gpg --export --armor "jegj57@gmail.com" > gpg_public.asc

Export secret key

gpg --export-secret-keys --armor "jegj57@gmail.com" > gpg_secret.asc

Export trust database

gpg --export-ownertrust > gpg_trust.txt

Import public key

gpg --import gpg_public.asc

Import secret key (will ask for your key passphrase)

gpg --import gpg_secret.asc

Import trust

gpg --import-ownertrust gpg_trust.txt

Installation

curl -o- https://raw.githubusercontent.com/jegj/pdsync/v1.6.1/install.sh | bash

Install the script at $HOME/.local/bin/pdsync