PyWebScrapBook icon indicating copy to clipboard operation
PyWebScrapBook copied to clipboard

large backup dir

Open isaaclw opened this issue 2 years ago • 6 comments

My Web Scrab Book folder is 17G, and 15G of it is backups:

root@ohm:~# du -hs /opt/wsb/.wsb/backup
15G     /opt/wsb/.wsb/backup
root@ohm:~# du -hs /opt/wsb/.wsb/
15G     /opt/wsb/.wsb/
root@ohm:~# du -hs /opt/wsb/
17G     /opt/wsb/

Is that necessary? What does that folder do?

isaaclw avatar May 01 '22 22:05 isaaclw

Backups are not mandatory but may be used for version comparing (e.g. generated for a recapture) or corruption recovery (e.g. transaction failure, backend index generating and checking). You can delete them safely after making sure that they are obsolete.

danny0838 avatar May 03 '22 14:05 danny0838

Ok, so if I have other backups with another system, how can I delete these and ensure they're not re-created?

isaaclw avatar Jun 14 '22 17:06 isaaclw

You can simply tweak "backup" related options in WebScrapBook to disable backups.

danny0838 avatar Jun 16 '22 03:06 danny0838

Ok, I think that means in each plugin I have to uncheck 'backups'.

That's a bit tricky since I have multiple computers, so I just need to remember to check each one.

But maybe I can put a zero length file in place of .wsb/backup ? Then backups would continue to fail until I turn off the option?

isaaclw avatar Jun 17 '22 15:06 isaaclw

This is unexpected, but you can simply try and see if there's a problem.

danny0838 avatar Jun 17 '22 15:06 danny0838

Ok, zero length file didn't work, and symlink to /dev/null didn't work either.

I have all backup options turned off in my local plugin, and I don't see any options on the server.

I guess for now I'll just create a cron job that deletes anything older than... 7 days?

#!/bin/bash
BACKUP=/opt/wsb/.wsb/backup

BACKUP_EXPIRE=7

find "$BACKUP" -type f \( -mtime +"$BACKUP_EXPIRE" -o -ctime +"$BACKUP_EXPIRE" \) -exec rm {} \;

Just documenting this for others in case they're interested.

isaaclw avatar Jun 17 '22 15:06 isaaclw