Skip to content

Instantly share code, notes, and snippets.

Created September 11, 2015 06:01
What would you like to do?
Transfer latest screenshots from Kodi box - note use ssh config to make 'ssh kodi' work to your username/IP requirements
nfiles = ARGV[0]
puts "Transferring latest #{nfiles} screenshots to current directory"
cmd="ssh kodi <<'ENDSSH'
ls -t ~/Pictures/*.png | head -n #{nfiles}
files = `#{cmd}`
for file in files.lines
puts "FILE:"+file
cmd = 'scp kodi:'+file+' .'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment