-
-
Save TheAshwanik/6094507 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
computer = #path to movies directory | |
hd = #path to movies directory | |
def get_movies(path_comp, path_hd) | |
# Return ana rray with only the new movies. I exclude the directory Series in the search | |
return `ls #{path_comp} | grep -v Series`.split(/\n/) - `ls #{path_hd} | grep -v Series`.split(/\n/) | |
end | |
new_movies_list = get_movies(computer, hd) | |
new_movies_list.each do |movie| | |
`cp -R #{computer}/"#{movie}" #{hd}` | |
puts "cp #{movie} to hard drive" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment