-
-
Save Redrield/81dd7c0cebd5760c65d1127495e487f8 to your computer and use it in GitHub Desktop.
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/env python3 | |
import os | |
from os.path import basename | |
import pyinotify | |
dirname = "/home/redrield/Documents/Classroom" # Change your dirname to whatever | |
watchManager = pyinotify.WatchManager() | |
mask = pyinotify.IN_DELETE | pyinotify.IN_MODIFY | pyinotify.IN_CREATE | |
watchManager.add_watch(dirname, rec=True, mask=mask) | |
def handler(ev): | |
os.system("""rclone sync {} "School Drive:/{}" """.format(dirname, basename(dirname))) # Change School Drive to the name of your drive | |
notifier = pyinotify.Notifier(watchManager, handler) | |
notifier.loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment