1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/bash #security camera companion script #move recent images into a folder so they aren't deleted if [[ $1 ]]; then n=${1} else n=40 fi mv `ls -rt *png | tail -n ${n}` save/ chmod a-w save/*png #chmod a-w `ls -tr *png | tail -n ${n}`