Notes on archiving posts

master
Bob Mottram 2019-07-12 21:51:02 +01:00
parent 7dfa210023
commit de5c637241
2 changed files with 41 additions and 21 deletions

View File

@ -315,3 +315,23 @@ python3 epicyon.py --nickname [yournick] --domain [name] --follow othernick@doma
```
You may or may not need to use the *--port*, *--https* and *--tor* options, depending upon how your server was set up.
## Archiving posts
You can archive old posts with:
``` bash
python3 epicyon.py --archive [directory]
```
Which will move old posts to the given directory. You can also specify the number of weeks after which images will be archived, and the maximum number of posts within in/outboxes.
``` bash
python3 epicyon.py --archive [directory] --archiveweeks 4 --maxposts 256
```
If you want old posts to be deleted for data minimization purposes then the archive location can be set to */dev/null*.
``` bash
python3 epicyon.py --archive /dev/null --archiveweeks 4 --maxposts 256
```

View File

@ -408,6 +408,26 @@ if args.changepassword:
print('Passwords file not found')
sys.exit()
archiveWeeks=4
if args.archiveWeeks:
archiveWeeks=args.archiveWeeks
archiveMaxPosts=256
if args.archiveMaxPosts:
archiveMaxPosts=args.archiveMaxPosts
if args.archive:
if args.archive.lower().endswith('null') or \
args.archive.lower().endswith('delete') or \
args.archive.lower().endswith('none'):
args.archive=None
print('Archiving with deletion of old posts...')
else:
print('Archiving to '+args.archive+'...')
archiveMedia(baseDir,args.archive,archiveWeeks)
archivePosts(baseDir,args.archive,archiveMaxPosts)
print('Archiving complete')
sys.exit()
if not args.domain and not domain:
print('Specify a domain with --domain [name]')
sys.exit()
@ -440,26 +460,6 @@ if args.backgroundImage:
print('Background image was not added for '+args.nickname)
sys.exit()
archiveWeeks=4
if args.archiveWeeks:
archiveWeeks=args.archiveWeeks
archiveMaxPosts=256
if args.archiveMaxPosts:
archiveMaxPosts=args.archiveMaxPosts
if args.archive:
if args.archive.lower().endswith('null') or \
args.archive.lower().endswith('delete') or \
args.archive.lower().endswith('none'):
args.archive=None
print('Archiving with deletion of old posts...')
else:
print('Archiving to '+args.archive+'...')
archiveMedia(baseDir,args.archive,archiveWeeks)
archivePosts(baseDir,args.archive,archiveMaxPosts)
print('Archiving complete')
sys.exit()
if federationList:
print('Federating with: '+str(federationList))