X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=check_phone_videos_are_in_originals;h=0b1dd22db6b7800affc7f07db9372ff392e4a92a;hb=HEAD;hp=f002e59776f9dafd424c81c04ab9af7f93838de9;hpb=cb660ed1efe9806045d753d02e5c0b656919d639;p=videoscripts%2F.git diff --git a/check_phone_videos_are_in_originals b/check_phone_videos_are_in_originals index f002e59..0b1dd22 100755 --- a/check_phone_videos_are_in_originals +++ b/check_phone_videos_are_in_originals @@ -1,9 +1,16 @@ #!/bin/bash # Checks to make sure all videos off of phone have been copied to the Originals directory # If they are missing, it means Nextcloud missed them somehow. Copy them to New Memories then. +# 1) First connect the phone to a computer with USB debugging turned on. +# Authorize the connection +# 2) Execute the command "adb tcpip 5555" +# 3) Run the script, authorize the connection +# 4) Run the script again +# You should now be able to connect to the device wirelessly dcim_path="/storage/emulated/0/DCIM/Camera" originals="/naspool/dropbox/Originals" +organized_logs="/var/log/organize" new_memories="/naspool/dropbox/New Memories" adb connect 192.168.0.23 @@ -17,8 +24,19 @@ mp4s_in_originals=$(/bin/ls -1 $originals/*.mp4 | xargs -n 1 basename) for i in $mp4s_on_phone; do echo "$mp4s_in_originals" | grep -q $i - if [[ $? == 1 ]]; then - echo "mp4 not found in originals: $i" - adb -e pull "$dcim_path/$i" "$new_memories" - fi + if [[ $? != 0 ]]; then + zgrep -q $i $organized_logs/organize_videos* + if [[ $? != 0 ]]; then + echo "mp4 not found in originals or organize logs: $i" + if [[ ! -e "$new_memories/$i" ]]; then + adb -e pull "$dcim_path/$i" "$new_memories" + else + echo "mp4 already copied into $new_memories" + fi + else + echo "mp4 found in originals or organize logs: $i" + fi + else + echo "mp4 found in originals or organize logs: $i" + fi done