Skip to content

python script for checking database and sync dir for orphaned files

Notifications You must be signed in to change notification settings

patrick-atgithub/joplintool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

joplintool

joplintool 0.9.21 (for joplin) by pat (based upon work from foxmask and tessus)

  • checks and removes orphaned files in local resourcedir and remote sync dir
  • shows some stats and a tree of your database
  • default is a dryrun, nothing will be deleted
  • removal of orphanes ignores timestamps...
  • removal in resourcedir uses webinterface
  • use --force if you know what you are doing
  • EXPORT A BACKUP BEFORE USE !

optional arguments:

-checkr, --checkresources checks for orphanes files in resourcedir

-checkd, --checkdropbox checks for orphanes files in dropboxdir

-force, --force enables delete for checkorphanes and checkdropbox

-r, --recurse recurses through folders and notes / shows tree

-a, --align deflate/pack db after data was deleted...

-i, --info shows how many notes, folders, imagerefs are stored in the db

checkdropbox option

  • checks if md files in sync dir can be found in database (note, folder, tag) of resourcedir (images)
  • if not found they will be removed with the --force option

checkresource option

  • checks if all files in resourcedir are assocciated with any note)
  • does NOT consider timestamps ...
  • if not found they will be removed with the --force option

used sql query:

            SELECT resource_id FROM note_resources  
            WHERE is_associated = 0 and resource_id not in 
               (SELECT resource_id FROM note_resources 
                WHERE is_associated = 1) 
            ORDER BY resource_id

About

python script for checking database and sync dir for orphaned files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages