General
What you can do:
As probably stated in the readme, you can use the scripts to manage images.
Directories in cloned branch:
./images/ - real(!) files organized by date (year.month)
./collection/ - symlinks organized as defined by you labels/groups.
./imports/ - list of imports by date, represented as symlinks.
./home/ - scripts collection: descriptions below and by script's --help.
More documentation:
Sometimes you can read the instructions directly by opening script in text editor,
code commentary is not omitted there.
upload.py
$ python3 upload.py [--recursive] [--interactive] [-b] [-d] source [label_1 label_2 ..]
Non-interactive:
Copy images without individual review.
Additional arguments will create symbolic links to the whole group.
Examples:
Copy new files from SD card mounted '/media/mmcblk0' to 'images/'
do not preserve original directory structure, create symbolic links in 'collection/elbrus'
$ python3 upload.py -r -d "/media/mmcblk0/DCIM" elbrus`
Interactive:
Review images in terminal, assign individual image labels.
Groups of similar images, i.e bursts are supposed to be uploaded by just one image review.
You're asked to create path if it does not exist, default question answers are highlighted.
Slash (/) is allowed and will create sub-directories. Type 'exit' to leave interface.
Example of interactive usage:
$ python3 upload.py -i -r /media/mmcblk0/DCIM`
[image]
(labels) .. mountains/elbrus landscape snow
Unknown keyword 'snow', create? (y/N) .. y
Additional options:
--blind
will ignore file duplication and create given symlinks to files.
Files will not be written twice unless have different names and no metadata.
--recursive
will also copy sub-directories preserving the file structure in non-interactive mode
and staging for review all sub-directories in interactive mode.
--dcim
will break any sub-directories even if --recursive used non-interactively.
symlinks.py
$ python3 symlinks.py [--analyze]
Can restore broken symlinks and alerts about removed files.
Never remove image files, but remove symlinks instead.
--analyze
option will output extended information: number of images tracked, images untracked, long names,
also find images not represented as links and make symlinks to home/unlinked
genchecksums.py
$ python3 genchecksums.py
Generate integrity verification file: checksums.md5
Verify the correctness of the image files with command:
$ md5sum --check checksums.md5 | grep FAILED
Export file group by label
$ tar -h -czvf label.tar.gz -C collection label
To actually copy files without writing and decompressing archive use pipes:
$ tar -czhf - -C collection label | mbuffer -m 512M | tar xf - -C destination/
This can also be used to efficiently transfer large directories between disks.
mbuffer will prevent kernel from taking all available memory and tar opens
all files at once instead of open/close sequentially,
the process is much faster and does not suffer the speed decrease.