Skip to content

Instantly share code, notes, and snippets.

@robbielj
robbielj / autosync.py
Created October 28, 2012 00:08
sync files in an "autosync" directory on seedbox to local linux NAS (my book live etc)
# sync files in an "autosync" directory on seedbox to local linux NAS (my book live etc)
# add this script to crontab
# this script will check whether local machine is online.
import subprocess, os, sys
import cPickle as pickle
def connchk(host,port):
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)