Compare commits
3 Commits
c68c379360
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1935dbfef8 | |||
| 239884f10b | |||
| 7493fd7a71 |
@@ -86,12 +86,16 @@ async function backupRecursive(dids, depth = 1) {
|
|||||||
}
|
}
|
||||||
var allrdids = new Set();
|
var allrdids = new Set();
|
||||||
for (var did of dids) {
|
for (var did of dids) {
|
||||||
|
try {
|
||||||
var repo = await backup(did);
|
var repo = await backup(did);
|
||||||
repo = ascii.decode(repo);
|
repo = ascii.decode(repo);
|
||||||
var rdids = new Set(repo.match(/did:plc:[a-z2-7]{24}/g));
|
var rdids = new Set(repo.match(/did:plc:[a-z2-7]{24}/g));
|
||||||
rdids.delete(did);
|
rdids.delete(did);
|
||||||
console.log(`${rdids.size} related didplcs`);
|
console.log(`${rdids.size} related didplcs`);
|
||||||
rdids.forEach(rdid => allrdids.add(rdid));
|
rdids.forEach(rdid => allrdids.add(rdid));
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await backupRecursive(allrdids, depth - 1);
|
await backupRecursive(allrdids, depth - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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!
|
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
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user