Skip to content

Instantly share code, notes, and snippets.

@taylor224
Last active May 10, 2017 22:52
Show Gist options
  • Save taylor224/6e1c657b19496d6c648e44f5a9a40175 to your computer and use it in GitHub Desktop.
Save taylor224/6e1c657b19496d6c648e44f5a9a40175 to your computer and use it in GitHub Desktop.
rclone Automatic Upload Script
#-*- 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()
#!/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