Simple Bluesky Backup Script

A script that downloads a Bluesky profile (repo and blobs) as well as all profiles referenced by (i.e. followed, liked, mentioned, replied to, blocked, listed, etc) that profile.

To backup one or more profiles and all related profiles:

$ node . did:plc:u4gngygg2w5egsigxu5g7byu # (you can put more than one did separated by spaces)

This will preserve all content they interacted with, such as posts they liked, replied to, quoted or reposted.

To backup a profile, all related profiles AND all profiles related to related profiles:

$ node . did:plc:u4gngygg2w5egsigxu5g7byu --depth=2

This will additionally save all profiles related to the profiles related to them, so you will have a copy of everything their friends liked and reposted as well. This may be a LOT of data!

To backup ONLY a single profiles (or list of profiles):

$ node . did:plc:u4gngygg2w5egsigxu5g7byu --depth=0

Run the script again to refresh the repos and download new blobs. New repo records are added to the database and deleted records are preserved but marked as deleted. Edited records are added as new entries and the old versions are marked as deleted.

Example SystemD

systemd timer is better than cron because it won't start it again if it's still running.

/etc/systemd/system/bskybackup.service

[Unit]
Description=Bluesky Backup script
After=network-online.target

[Service]
WorkingDirectory=/zpool1/FileStorage/srv/bskybackup/
User=bskybackup
ExecStart=node . did:plc:u4gngygg2w5egsigxu5g7byu
Type=exec

/etc/systemd/system/bskybackup.timer

[Unit]
Description=Daily Bluesky backup

[Timer]
OnCalendar=05:00:00

[Install]
WantedBy=timers.target
Description
preserve your local atmosphere
Readme 94 KiB
Languages
JavaScript 100%