On the LabKey Server, a folder can have a series of workbooks, which will be numered sequentially starting with 1. Assuming you computer has a folder with subfolders corresponding to workbooks, this tool can be used to sync files from these local folders to the server. Please see the script, syncFolder.py, for a more extensive explanation of the sync process and running the script.
The script has the following requirements:
- Install Python
- Download the WebDav-Sync JAR file
- Checkout or download the syncFolder.py file from this repository
See the example scripts in /example_usage. Execution is fairly simple:
python syncFolder.py \ --serverUrl="https://myServer.edu/" \ --labkeyFolderPath="/Labs/" \ --username="username" \ --password="password" \ --localFolder=/Expts \ --lastExecutionFile=/Expts/.lastWorkbookSync.txt \ --jarFile=webdav_sync1_1_8.jar 2>&1 > /Expts/sync-log.txt
In the above example, the file .lastWorkbookSync.txt will store the time of the last sync operation. The next sync will only attempt to sync directories with a file modified after this time. This can greatly reduce the runtime if your source files do not change often. Also, the above example saves the output of the last sync to sync-log.txt.
To run your script script on a schedule, consider cron for linux and osx. On windows, consider Task Scheduler.