1ac3db7f3d267c2852d42da712976fe2d962809a max Mon Oct 9 13:03:50 2017 -0700 CIRM: allowing symlinks in the little webSync tool diff --git src/utils/webSync src/utils/webSync index b8c6942..5a8c7df 100755 --- src/utils/webSync +++ src/utils/webSync @@ -4,32 +4,34 @@ from collections import defaultdict from os.path import join, basename, dirname, isfile, isdir import string logDir = "webSyncLog" flagFname = join(logDir, "isRunning.flag") # ==== functions ===== def parseArgs(): " setup logging, parse command line arguments and options. -h shows auto-generated help page " parser = optparse.OptionParser("""usage: %prog [options] <url> - download from https server, using files.txt on their end to get the list of files To create files.txt on the remote end, run this command: du -ab > files.txt - Or preferably this command (empty directories will lead to transmit errors): - find . -type f -exec du -ab {} + + Or preferably this command (otherwise empty directories will lead to "transmit" errors): + find . -type f -exec du -ab {} + > files.txt + Or this one if you have symlinks: + find -L . -type f -exec du -Lab {} + > files.txt Then run this in the download directory: webSync https://there.org/ This will create a "webSyncLog" directory in the current directory, compare https://there.org/files.txt with the files in the current directory, transfer the missing files and write the changes to webSync/transfer.log. The URL will be saved after the first run and is not necessary from then on. You can add cd xxx && webSync to your crontab. It will not start if it's already running (flagfile). Status files after a run: - webSyncLog/biggerHere.txt - list of files that are bigger here. These could be errors or OK. - webSyncLog/files.here.txt - the list of files here - webSyncLog/files.there.txt - the list of files there, current copy of https://there.org/files.txt