3 Commits

Author SHA1 Message Date
lamp 1935dbfef8 Update readme.md 2024-12-04 22:56:54 -06:00
lamp 239884f10b catch 2024-12-03 23:24:37 -08:00
lamp 7493fd7a71 systemd 2024-12-03 22:57:13 -08:00
2 changed files with 40 additions and 7 deletions
+4
View File
@@ -86,12 +86,16 @@ async function backupRecursive(dids, depth = 1) {
}
var allrdids = new Set();
for (var did of dids) {
try {
var repo = await backup(did);
repo = ascii.decode(repo);
var rdids = new Set(repo.match(/did:plc:[a-z2-7]{24}/g));
rdids.delete(did);
console.log(`${rdids.size} related didplcs`);
rdids.forEach(rdid => allrdids.add(rdid));
} catch (error) {
console.error(error);
}
}
await backupRecursive(allrdids, depth - 1);
}
+30 -1
View File
@@ -20,4 +20,33 @@ $ deno run --allow-all bskybackup.deno.js did:plc:u4gngygg2w5egsigxu5g7byu --dep
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!
Running the script again will refresh the repositories and download new blobs. Existing blobs are not re-downloaded.
Running the script again will refresh the repositories and download new blobs. Existing blobs are not re-downloaded. Run the script regularly to keep the backups up to date.
## 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
```systemd
[Unit]
Description=Bluesky Backup script
After=network-online.target
[Service]
WorkingDirectory=/zpool1/FileStorage/srv/bskybackup/
User=bskybackup
ExecStart=deno run --allow-all bskybackup.deno.js did:plc:u4gngygg2w5egsigxu5g7byu
Type=exec
```
/etc/systemd/system/bskybackup.timer
```systemd
[Unit]
Description=Daily Bluesky backup
[Timer]
OnCalendar=05:00:00
[Install]
WantedBy=timers.target
```