title: Import video to iOS Gallery using bash script
body: <p>I am writing a bash video downloader script for iOS, and I would like to know how can I save the downloaded videos to the Gallery. 
  So far I got to this point:</p>
  
  <pre><code>mv $title.$ext /var/mobile/Media/DCIM/100APPLE/IMG_$(printf '%04d\n' $((10#$(ls /var/mobile/Media/DCIM/100APPLE | tail -n 1 | sed 's/.*_//' | cut -f 1 -d'.') + 1))).$ext
  </code></pre>
  
  <p>To move the video into the Gallery and</p>
  
  <pre><code>rm /var/mobile/Media/PhotoData/Photos.sqlite-shm /var/mobile/Media/PhotoData/Photos.sqlite-wal
  </code></pre>
  
  <p>To refresh the gallery, but this last command does not work. I know I can remove the whole PhotoData directory but then a reboot is needed and a long wait for the gallery to reload all the photos and videos.
  Is there another way I can do this?
  Thanks in advance. </p>