Ask / Submit

[App request]Organizing the photos in subfolders by month

asked 2015-02-28 15:58:03 +0300

bennypr0fane gravatar image

I would like to organize all the photos taken by the camera into subfolders by month, i.e. perform this action once on existing pics and then keep filing every new pic in monthly subfolders (maybe frequent shooters would even like the option to have one folder for each week, but for me monthly is certainly enough)! This is not about how the photos are viewed in the Gallery, but where/how they are stored in the file system! Who can make that happen? (note: not a duplicate of this

edit retag flag offensive close delete



I'd like to suggest an addition for naming the folders. (Pretty) please make it so that the folders will be named 01 January, 02 February, etc. This way they stay organized.

raketti ( 2015-02-28 19:35:50 +0300 )edit

@raketti I was thinking along the lines of 2015-01, 2015-02 etc. for folder names. Do you mean you want the names of months rather than numbers? If so, what would be the advantage of that? It seems to me that it would be more difficult to automate. Or what is it more precisely that you have in mind?

bennypr0fane ( 2015-02-28 21:22:38 +0300 )edit

@bennypr0fane no no no.. :D The names of the months weren't the point. Should have left them out, the point was the numbering. Sorry to have mislead you (or anyone else). But what you suggested would be perfect for my needs, as I already have already named my back-up folders this way. :P

raketti ( 2015-02-28 21:50:26 +0300 )edit

3 Answers

Sort by » oldest newest most voted

answered 2015-02-28 20:43:55 +0300

lakutalo gravatar image

updated 2015-08-03 22:20:13 +0300

I support the idea, it is more or less a standard option in cameras. In the mean time you can help yourself by using this script I have assembled here.

cd "$DIR"
for file in *; do
if [ -f $file ]
dname=`date $FORMAT -r$file`
mkdir -p "$dname"
mv "$file" "$TODIR"/"$dname"

It moves all files from your camera dir to folders like 2015-02. To be cautious, it would be a good idea to try this with other DIR and TODIR first.

To change the format of the output directory, change FORMAT from %Y-%m to whatever you like (have a look in date options). You might even use it to move or save your pictures to your sd-card by changing TODIR.

If desired the script could be launched periodically.

As precaution you should always check your sdcard's path - and alter it in the script if necessary - after you have changed or replaced it, since the mount point might change even if you reinsert the same card.

edit flag offensive delete publish link more


Actually I ran in to this and this topic about timed events. :)

raketti ( 2015-02-28 21:04:36 +0300 )edit

If we can just get this bash script without the timed option yet, that would be a great first step. We have a great app called ShellEx, that lets you store any command and launch it with a single tap. I would combine it with an Rsync command for uploading to Owncloud. Also the latest version of our Owncloud app includes an upload daemon that watches the Camera folder.

bennypr0fane ( 2015-02-28 21:19:31 +0300 )edit

Cool idea! I don't know if camera events are read out via dbus. If so you could trigger the reorganising script this way: And if there is time I could create a bash prototype script, unless someone else volunteers. :)

lakutalo ( 2015-02-28 21:25:36 +0300 )edit

So what could this bash script look like? Something using mv, probably, or rename?

bennypr0fane ( 2015-02-28 21:29:57 +0300 )edit

You name it! :) I'd look for existing folders formatted by a template string and create if not existing. Then look up change date of picture and move it there. Of course all statements in correct order as this is too superficially described. But I am sure there are many examples to find in the depth of the ocean.

lakutalo ( 2015-02-28 21:33:41 +0300 )edit

answered 2015-03-02 13:20:23 +0300

netvandal gravatar image

Photos are indexed by tracker, displaying folder based on photos taken by date should be quite easy, even without moving photos around the filesystem, but using tracker data or exif metadata. There is any plan to opensource the gallery code?

edit flag offensive delete publish link more



Gallery view is not the topic here, it is over there:

bennypr0fane ( 2015-03-02 13:24:17 +0300 )edit

ups, sorry, i understood the question on the wrong side :)

netvandal ( 2015-03-02 13:29:01 +0300 )edit

no prob, any idea much appreciated!

lakutalo ( 2015-03-02 13:50:58 +0300 )edit

answered 2015-03-07 01:21:30 +0300

Odorobo gravatar image

updated 2015-03-07 01:21:53 +0300

I'd support any organisation of photos in gallery except current.
Also, sharing for awareness/voting:

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2015-02-28 15:58:03 +0300

Seen: 895 times

Last updated: Aug 03 '15