Skip to content

Commit

Permalink
desktop: auto commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kovetskiy committed Jul 15, 2020
1 parent 2e20bdb commit ae50895
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 16 deletions.
24 changes: 24 additions & 0 deletions bin/dropbox-wait
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

systemctl --user start dropbox
echo "service: started"

echo -n "syncing..."
syncing=false
while :; do
s=$(dropbox-cli status)
if [[ "$s" =~ "Up to date" ]]; then
if $syncing; then
echo "OK"
exit 0
fi
else
syncing=true
fi

echo -n "."
sleep 0.2
done

systemctl --user stop dropbox
echo "service: stopped"
16 changes: 16 additions & 0 deletions bin/jpgs-sort-to-dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#07.14
#01.17
for x in *.JPG; do
date=$(identify -format '%[EXIF:DateTime]' $x);
day=$(cut -d' ' -f1 <<< "$date" | sed 's@:@-@g')
if [[ "$day" =~ ^2019 ]]; then
hm=$(cut -d' ' -f2 <<< "$date")
from_iso=$(date --iso-8601=n -d "$day $hm")
to_iso=$(date --iso-8601=n -d "$from_iso + 544 days + 20 hours")
day="$(date '+%Y-%m-%d' -d "$to_iso")"
fi
mkdir -p "$day"
mv -v "$x" "$day/"
done
19 changes: 3 additions & 16 deletions bin/photo
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,7 @@ else
sudo mount -o umask=0022,gid=$gid,uid=$uid $device /media/sony

sxiv -o /media/sony/DCIM/100MSDCF/ | xargs -n1 -I{} rsync -avp {} ~/Dropbox/Photos/
systemctl --user start dropbox
started=false
while :; do
s=$(dropbox-cli status)
echo "---------------------------------------------"
date '+%T'
echo "$s"
if [[ "$s" =~ "Up to date" ]]; then
if $started; then
exit 0
fi
else
started=true
fi
sleep 1
done
cd ~/Dropbox/Photos/
jpgs-sort-to-dirs
dropbox-wait
fi

0 comments on commit ae50895

Please sign in to comment.