From 6a139af31433dd9016e017c5f32b2be048717377 Mon Sep 17 00:00:00 2001 From: judahpaul16 Date: Tue, 30 Apr 2024 17:38:50 -0400 Subject: [PATCH] Updated docs --- .bumpversion.cfg | 2 +- README.md | 66 +++++++++++++++++++++++++++++++++++-------- docs/api_reference.md | 4 ++- docs/cli_reference.md | 44 +++++++++++++++++++++++++++++ setup.py | 2 +- 5 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 docs/cli_reference.md diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6637df3..9591f02 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.0 +current_version = 0.1.1 commit = True tag = True diff --git a/README.md b/README.md index a603d77..8398cbe 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,9 @@ Python UrBackup is a powerful Python wrapper designed to interact with UrBackup ## Installation Install with: - - pip3 install python-urbackup - -To update the "Usage" section of your GitHub README, we can provide a more detailed and structured snippet that reflects the initialization, login, and some common operations with the `urbackup_server` class. Here is the revised "Usage" section that can be added: +```bash +pip install python-urbackup +``` ## Usage @@ -27,7 +26,7 @@ Create an instance of the `urbackup_server` by specifying the server URL, userna ```python from urbackup import urbackup_server -backup_server = urbackup_server('your_server_url', 'your_username', 'your_password') +server = urbackup_server('your_server_url', 'your_username', 'your_password') ``` ### Logging In @@ -35,7 +34,7 @@ backup_server = urbackup_server('your_server_url', 'your_username', 'your_passwo To perform any operations, you need to log in: ```python -if backup_server.login(): +if server.login(): print("Login successful!") else: print("Login failed!") @@ -46,7 +45,7 @@ else: Retrieve the status of a specific client: ```python -client_status = backup_server.get_client_status('client_name') +client_status = server.get_client_status('client_name') if client_status: print(f"Client status: {client_status}") else: @@ -58,7 +57,7 @@ else: To download an installer for a new client, specify the file path and the client's name: ```python -if backup_server.download_installer('path/to/installer', 'new_client_name'): +if server.download_installer('path/to/installer', 'new_client_name'): print("Installer downloaded successfully.") else: print("Failed to download installer.") @@ -69,12 +68,12 @@ else: You can start different types of backups for a client. Here are examples of starting an incremental file backup and a full file backup: ```python -if backup_server.start_incr_file_backup('client_name'): +if server.start_incr_file_backup('client_name'): print("Incremental file backup started successfully.") else: print("Failed to start incremental file backup.") -if backup_server.start_full_file_backup('client_name'): +if server.start_full_file_backup('client_name'): print("Full file backup started successfully.") else: print("Failed to start full file backup.") @@ -85,7 +84,7 @@ else: Add a new client to the server: ```python -new_client = backup_server.add_client('new_client_name') +new_client = server.add_client('new_client_name') if new_client: print("New client added:", new_client) else: @@ -115,6 +114,51 @@ for client in clients: For more information, please refer to the [API Reference](https://python-urbackup.readthedocs.io/en/latest/api_reference/). +## UrBackup CLI + +The UrBackup CLI is a command-line interface that allows you to interact with the UrBackup server from a client machine. + +*Important Note: For Windows the command-line tool is `urbackupclient_cmd`. Mac and Linux use `urbackupclientctl`.* + +CLI options for `urbackupclientctl` and `urbackupclientctl` are as follows: + +```sh +USAGE: + + urbackupclientctl [--help] [--version] [] + +Get specific command help with urbackupclientctl --help + + urbackupclientctl start + Start an incremental/full image/file backup + + urbackupclientctl status + Get current backup status + + urbackupclientctl browse + Browse backups and files/folders in backups + + urbackupclientctl restore-start + Restore files/folders from backup + + urbackupclientctl set-settings + Set backup settings + + urbackupclientctl reset-keep + Reset keeping files during incremental backups + + urbackupclientctl add-backupdir + Add new directory to backup set + + urbackupclientctl list-backupdirs + List directories that are being backed up + + urbackupclientctl remove-backupdir + Remove directory from backup set +``` + +For more information, please refer to the [UrBackup Administration Documentation](https://www.urbackup.org/administration_manual.html). + ## Contributing 🤝 Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests. diff --git a/docs/api_reference.md b/docs/api_reference.md index 90a6aa0..77117e6 100644 --- a/docs/api_reference.md +++ b/docs/api_reference.md @@ -1,4 +1,4 @@ -# API Reference +# API Reference This section provides detailed documentation for all functions and classes available in the Python UrBackup API. @@ -66,3 +66,5 @@ This class provides methods to interact with the UrBackup server. - `_md5(s)`: Calculates the MD5 hash of a given string. Please refer to the source code for more detailed information on each method, including parameters and expected response types. + +For more specific information regarding urbackup administration, please refer to the [official UrBackup documentation](https://www.urbackup.org/administration_manual.html). \ No newline at end of file diff --git a/docs/cli_reference.md b/docs/cli_reference.md new file mode 100644 index 0000000..2ec876b --- /dev/null +++ b/docs/cli_reference.md @@ -0,0 +1,44 @@ +# CLI Reference + +The UrBackup CLI is a command-line interface that allows you to interact with the UrBackup server from a client machine. + +*Important Note: For Windows the command-line tool is `urbackupclient_cmd`, usually located at `C:\Program Files\UrBackup\UrBackupClient_cmd.exe`. Mac and Linux use `urbackupclientctl`.* + +CLI options for `urbackupclientctl` and `urbackupclientctl` are as follows: + +```sh +USAGE: + + urbackupclientctl [--help] [--version] [] + +Get specific command help with urbackupclientctl --help + + urbackupclientctl start + Start an incremental/full image/file backup + + urbackupclientctl status + Get current backup status + + urbackupclientctl browse + Browse backups and files/folders in backups + + urbackupclientctl restore-start + Restore files/folders from backup + + urbackupclientctl set-settings + Set backup settings + + urbackupclientctl reset-keep + Reset keeping files during incremental backups + + urbackupclientctl add-backupdir + Add new directory to backup set + + urbackupclientctl list-backupdirs + List directories that are being backed up + + urbackupclientctl remove-backupdir + Remove directory from backup set +``` + +For more information, please refer to the [UrBackup Administration Documentation](https://www.urbackup.org/administration_manual.html). \ No newline at end of file diff --git a/setup.py b/setup.py index eef729a..437e45a 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.1.0', + version='0.1.1', description='Python wrapper to access and control an UrBackup server', long_description=long_description,