Created
September 11, 2015 06:01
-
-
Save gordonbanderson/4f8198d3df6acc94b860 to your computer and use it in GitHub Desktop.
Transfer latest screenshots from Kodi box - note use ssh config to make 'ssh kodi' work to your username/IP requirements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
nfiles = ARGV[0] | |
puts "Transferring latest #{nfiles} screenshots to current directory" | |
cmd="ssh kodi <<'ENDSSH' | |
ls -t ~/Pictures/*.png | head -n #{nfiles} | |
ENDSSH" | |
files = `#{cmd}` | |
for file in files.lines | |
file.strip! | |
puts "FILE:"+file | |
cmd = 'scp kodi:'+file+' .' | |
`#{cmd}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment