Pokušavam razvrstati po datumira veći broj slika koje nalaze u nekom folderu, npr. ~/Desktop/slike. To znači sve slike istog datuma u zasebnom folderu (YY-MM-DD). Dosta sam googlao; uglavnom se predlažu programi (F-Spot, Shotwell, DigiKam, Picasa i sl.) koji nude samo pregled.
Zato mi je pala na pamet (naizgled) jednostavna bash skripta - ideju sam dobio ovdje: http://www.linuxquestions.org/questions ... te-722733/
Stalno negdje grješim u koracima, pa molim pomoć....
Hvala!
Abzeenth je napisao/la:Dobro onda. Baš me briga. Krepajte od offtopica.
jurastublic je napisao/la:Ovaj thread me podsjeća na krepanu mačku. Treba to pokupit lopatom i zakopat. Onda dezinficirati lopatu.
#!/bin/bash
#
#
Location="~/Desktop/fotografije/"
Destination="~/Desktop/fotografije/"
echo
echo
############
# rename all image files in $Location
jhead -n%Y/%m/%d/%f *.jpg
###########
# Sort files into folders using $CharFromName letters of the file name
#
ls $Destination | while read file; do
# extract first $CharFromName characters from filename
FolderDate=${file:0:$CharFromName}
# create directory if it does not exist
test -d $Destination/$FolderDate || mkdir $Destination/$FolderDate
# move the current file to the destination dir
mv -v $Destination/$file $Destination/$FolderDate/$file
done
##########
# move sorted files into photo library
#mv -v $Destination/* $Destination/
##########
# End notification
echo "End location: $Destination"
echo
read -p "Press enter to close this window…"
Abzeenth je napisao/la:Dobro onda. Baš me briga. Krepajte od offtopica.
jurastublic je napisao/la:Ovaj thread me podsjeća na krepanu mačku. Treba to pokupit lopatom i zakopat. Onda dezinficirati lopatu.
I'm a Paladin with 18 charisma and 97 hit points. I can use my helm of disintegration and do one D4 damage as my half-elf mage wields his plus-five holy avenger.
I'm a Paladin with 18 charisma and 97 hit points. I can use my helm of disintegration and do one D4 damage as my half-elf mage wields his plus-five holy avenger.
#!/bin/sh
# Goes through all jpeg files in current directory, grabs date from each
# and sorts them into subdirectories according to the date
# Creates subdirectories corresponding to the dates as necessary.
for fil in * # Also try *.JPG
do
datepath="$(identify -verbose $fil | grep DateTimeOri | awk '{print $2 }' | sed s%:%/%g)"
if ! test -e "$datepath"; then
mkdir -pv "$datepath"
fi
mv -v $fil $datepath
done
Skriptu treba kopirati u folder u kojem se nalaze fotografije i zatim ju pokrenuti. Sve radi, samo treba čekati par sekundi. Slike se razvrstavaju po datumu kada su nastale, a ne kada su modificirane (isprobao!). Jedina je mana što se razvrstavaju samo slike, ali ne i filmovi (avi). Može tu mala pomoć?
Abzeenth je napisao/la:Dobro onda. Baš me briga. Krepajte od offtopica.
jurastublic je napisao/la:Ovaj thread me podsjeća na krepanu mačku. Treba to pokupit lopatom i zakopat. Onda dezinficirati lopatu.
I'm a Paladin with 18 charisma and 97 hit points. I can use my helm of disintegration and do one D4 damage as my half-elf mage wields his plus-five holy avenger.
#!/bin/bash
#
#
Location="~/Desktop/fotografije/"
CharFromName=4
echo
echo
############
# rename all image files in $Location
# FolderDateDD-HHMMSS.ext
jhead -n%Y/%m/%d/%f *
###########
# Sort files into folders using $CharFromName letters of the file name
#
ls $Location | while read file; do
# extract first $CharFromName characters from filename
FolderDate=${file:0:$CharFromName}
# create directory if it does not exist
test -d $Location/$FolderDate || mkdir $Location/$FolderDate
# move the current file to the destination dir
mv -v $Location/$file $Location/$FolderDate/$file
done
##########
# move sorted files into photo library
#mv -v $Locaion/* $Location/$FolderDate
##########
# End notification
echo
read -p "Press enter to close this window…"
... i nova skripta koja dobro razvrstava fotografije, ali ne razvrstava filmove:
#!/bin/sh
# Goes through all jpeg files in current directory, grabs original date from each
# and sorts them into subdirectories according to the date
# Creates subdirectories corresponding to the dates as necessary.
for fil in * # Also try *.JPG # # Also try *.AVI
do
datepath="$(identify -verbose $fil | grep DateTimeOri | awk '{print $2 }' | sed s%:%/%g)"
if ! test -e "$datepath"; then
mkdir -pv "$datepath"
fi
mv -v $fil $datepath
done
Abzeenth je napisao/la:Dobro onda. Baš me briga. Krepajte od offtopica.
jurastublic je napisao/la:Ovaj thread me podsjeća na krepanu mačku. Treba to pokupit lopatom i zakopat. Onda dezinficirati lopatu.
cinober je napisao/la:neznam šta je jhead ali možda ovako radi
jhead -n %Y/%m/%d/%f *.jpg
I'm a Paladin with 18 charisma and 97 hit points. I can use my helm of disintegration and do one D4 damage as my half-elf mage wields his plus-five holy avenger.