Last active
May 10, 2017 22:52
-
-
Save taylor224/6e1c657b19496d6c648e44f5a9a40175 to your computer and use it in GitHub Desktop.
rclone Automatic Upload Script
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
#-*- coding: utf-8 -*- | |
import os | |
import subprocess | |
ROOT_DIR = '/home/user/data/' | |
REMOTE_ROOT_DIR = '/Documents/data/' | |
for dir in os.listdir(ROOT_DIR): | |
if not os.path.isdir(os.path.join(ROOT_DIR, dir)): | |
continue | |
print('Main Directory : ' + dir) | |
command = ['rclone', 'move', '--include', '*', ROOT_DIR + dir + '/', 'ACD:' + REMOTE_ROOT_DIR + dir + '/'] | |
result = subprocess.Popen(command) | |
result.communicate() |
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
#!/bin/sh | |
PATH=/opt/someApp/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
python /home/user/run.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment