A script to synchronize directories from IS.MUNI to your local machine.
-
Clone the repository:
git clone https://github.com/your-username/IS.MUNI-sync.git cd IS.MUNI-sync
-
Copy the example configuration file and customize it:
cp config.ini.example config.ini
-
Open
config.ini
in your favorite text editor and update the values as needed. Here's a brief explanation of each setting:ROOT_DIR
: The root directory on your local machine where the synchronized directories will be stored.LOG_LEVEL
: The logging level for script execution. Valid values are DEBUG, INFO, WARNING, ERROR, and CRITICAL.- Under
[Channels]
, each entry represents a channel you want to synchronize. The key is the name of the local directory (relative toROOT_DIR
), and the value is the path on the server afterhttps://is.muni.cz/auth/
.
Example:
[Settings] ROOT_DIR = ~/muni_sync LOG_LEVEL = INFO [Channels] IA174 = /el/fi/podzim2023/IA174/um/slides_plain/before_lecture/ PV079 = /el/fi/podzim2023/PV079/um/lectures/ # Add more directories as needed
-
Set up environment variables for authentication:
IS_USERNAME
: Your non-personal UCO.IS_PASSWORD
: Your non-personal is.muni.cz password.
It's recommended to use a non-personal account for this synchronization to ensure security, but your personal account will work. See the IS.MUNI API in the IS help for more information.
export IS_USERNAME='your-username' export IS_PASSWORD='your-password'
-
Run the script:
python3 main.py
usage: main.py [-h] [--log LOG] [--config CONFIG]
Directory synchronization script.
optional arguments:
-h, --help show this help message and exit
--log LOG Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--config CONFIG Path to the config.ini.
To utilize plugins, specify them under the [Plugins] section in the config.ini file, with the format plugin_name = channels. Here, plugin_name is the name of the plugin, and channels is a comma-separated list of channel names where the plugin should be applied.
[Plugins]
EmbedFonts = PV079
Automatically embeds fonts in downloaded PDF files ensuring visual consistency
across different systems. Requires Ghostscript (command gs
) and pdffonts
tool installed.