to get images from an SD card labeled CANON_730 to a local directory

  • NOTE: must change to the directory where the files go BEFORE executing script
  • NOTE: "/Volumes" will need to be replaced with the mount point used on your system, in Linux this will vary depending on your distribution and configuration.
  • If you have an automatic mounting daemon running look for the mount with a "df -h". Recommend mounting manually: mkdir -p /home/luser/SDCARD ; sudo fdisk -l ; mount /dev/sdX /home/luser/SDCARD"
  • Recommend creating a "bin" directory and adding it to your path in your .bashrc file (see this site for examples).
  • Create the script in your bin directory and "chmod 740 scriptname". Type "which scriptname", if it appears, it'll work.

--> cat ~/bin/get730 #!/bin/bash # mv /Volumes/NIKON_D750/DCIM/102ND750/* . ; sudo umount /Volumes/NIKON_D750/ ; ls # mv /Volumes/CANON_DC/DCIM/105___01/* . ; sudo umount /Volumes/CANON_DC/ ; ls # rename dir monthly export CARD730="/Volumes/CANON_730/" export DIR730="/Volumes/CANON_730/DCIM/101___05" # # ls $DIR730 echo "run from directory where fotos go - hit return if ok..." read for x in `ls $DIR730` do echo $x mv "$DIR730/$x" SX730-$x done echo "-------------" ls $DIR730 echo "-------------" echo "if dir empty, hit return to umount" read echo "umount card" echo "-------------" sudo umount $CARD730 sudo diskutil unmount $CARD730 ls

other variations of script

--> cat ~/bin/getnikon #!/bin/bash mv /Volumes/NIKON_D750/DCIM/102ND750/* . ; sudo umount /Volumes/NIKON_D750/ ; ls # mv /Volumes/CANON_DC/DCIM/105___01/* . ; sudo umount /Volumes/CANON_DC/ ; ls

if you have a CANON it changes directories monthly...

--> cat ~/bin/getcanon #!/bin/bash # mv /Volumes/NIKON_D750/DCIM/102ND750/* . ; sudo umount /Volumes/NIKON_D750/ ; ls # mv /Volumes/CANON_DC/DCIM/105___01/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/106___02/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/107___03/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/108___04/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/109___05/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/110___06/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/111___07/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/111___07/* . # mv /Volumes/CANON_DC/DCIM/112___07/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/113___08/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/114___09/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/115___10/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/116___11/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/117___12/* . ; sudo umount /Volumes/CANON_DC/ ; ls ; # /Volumes/CANON_DC/DCIM/118___01/ # mv /Volumes/CANON_DC/DCIM/118___01/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/119___02/* . # ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/120___03/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/121___04/* . ; sudo umount /Volumes/CANON_DC/ ; ls # mv /Volumes/CANON_DC/DCIM/122___05/* . mv /Volumes/CANON_DC/DCIM/123___05/* . ; sudo umount /Volumes/CANON_DC/ ; ls

JohnMeister.com Today's Date:

Simply Linux: Basics  Full Size Jeep Buyer's Guide Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
Linux Tackles Microsoft
Video Course:
The Art of Linux System Administration, and a
Study Guide for the LPIC-2 Certification Exams.

-- O'Reilly Media author info
FULL SIZE JEEP

Buyer's Guide

SJ model Jeeps
"Jeep is America's
only real sports car."
-Enzo Ferrari


Mercedes, VW, and other Diesels
Nikon cameras
general tech info
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it
installed locally in WA at:

- Fleet Services 425.355.4440 - Everett
- Midway Auto 360.668.7111 - Clearview/Snohomish
- Northland Diesel 360.676.1970 - Bellingham