Skip to content

Instantly share code, notes, and snippets.

@sandrods
Created May 18, 2011 02:58
Show Gist options
  • Save sandrods/977916 to your computer and use it in GitHub Desktop.
Save sandrods/977916 to your computer and use it in GitHub Desktop.
Sync Movies
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.sync_movies</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>1</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>ProgramArguments</key>
<array>
<string>/Users/sandro/Movies/.sync/sync_movies</string>
</array>
<key>StandardOutPath</key>
<string>/Users/sandro/Library/Logs/sync_movies.log</string>
<key>StandardErrorPath</key>
<string>/Users/sandro/Library/Logs/sync_movies.err.log</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
#!/usr/bin/env ruby
require 'FileUtils'
FROM = "/Users/sandro/Movies/_ready/*"
TO = "/Volumes/SDSTC/Plex/Movies"
Dir.glob(FROM) do |file|
puts "Moving #{file}"
FileUtils.mv(file, TO)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment