# dirconfig 📂
[![PyPI](https://img.shields.io/pypi/v/dirconfig)](https://pypi.org/project/dirconfig/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dirconfig)
[![PyPI - License](https://img.shields.io/pypi/l/dirconfig)](LICENSE)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/judahpaul16/dirconfig/workflow.yaml)](https://github.com/judahpaul16/dirconfig/actions)
Configure what files should be in what folders using an easy-to-read YAML config file.
## Features
- [x] **File Organization**: Automatically move files based on their extension from one directory to another.
- [x] **Automated Backups**: Set up scheduled backups for important directories using [urbackup](https://github.com/uroni/urbackup-server-python-web-api-wrapper).
- [ ] **Notification System**: Get notified regarding specific events specified in the configuration file.
## Installation
Install **dirconfig** using pip:
```sh
pip install dirconfig
```
## Configuration
Create a `config.yml` file in your working directory with your automation tasks. Here's an example configuration that organizes `.jpg` and `.pdf` files into separate directories:
```yaml
tasks:
- name: Organize Downloads
type: file-organization
source: /path/to/your/source/directory
rules:
- extension: .jpg
destination: /path/to/your/destination/for/images
- extension: .pdf
destination: /path/to/your/destination/for/documents
backup:
- name: Backup Important Files
type: incremental-file # incremental-image, full-file, full-image
schedule: daily # weekly, monthly
retention: 7 # number of days to keep backups
connection:
server: http://your-backup-server:55414
username: foo
password: bar
directories:
- /path/to/your/important/directory
- /path/to/another/important/directory
```
## Usage
**dirconfig** is designed to run as a daemon, monitoring specified directories and automatically organizing files according to the configurations defined in your `config.yml` file.
You can generate a sample `config.yml` file using the following command:
```sh
dirconfig generate
```
### Starting dirconfig
To initiate **dirconfig** and begin the monitoring process, use the following command:
```sh
dirconfig start
```
This command starts **dirconfig**, which operates in the background. It will watch the source directories specified in your `config.yml` for any changes, organizing files according to your predefined rules.
Alternatively, to run **dirconfig** as a separate process, use the following command:
```sh
dirconfig start &
```
### Stopping dirconfig
To stop the **dirconfig** daemon, execute:
```sh
dirconfig stop
```
This command stops the background process of **dirconfig**, halting the monitoring and file organization tasks.
### Command Line Options
```sh
usage: dirconfig [-h] [--config CONFIG] [--log LOG] [--pid PID] {start,stop,generate}
dirconfig Daemon
positional arguments:
{start,stop,generate}
Dirconfig actions to perform
options:
-h, --help show this help message and exit
--config CONFIG Path to the configuration file
--log LOG Path to the log file
--pid PID Path to the PID file
```
### Advanced Management
For long-term operation or deployment, integrating **dirconfig** with system services or process managers can offer more graceful management, including automatic restarts, logging, and simplified start/stop operations.
## Extending dirconfig
**dirconfig** welcomes enhancements and customization. If you're interested in adding new features or improving the tool, consider contributing to the source code. Your input and contributions are highly appreciated.
## Urbackup Documentation
For more information on the Urbackup API, please refer to these resources:
* *[Urbackup Python API Wrapper](https://github.com/uroni/urbackup-server-python-web-api-wrapper)*
* *[Urbackup Backend ClientCTL](https://github.com/uroni/urbackup_backend/tree/dev/clientctl)*
*Important Note: For Windows the command-line tool is `urbackupclient_cmd`. Mac and Linux use `urbackupclientctl`.
Command Line Options for `urbackupclientctl` are as follows:
```sh
USAGE:
urbackupclientctl [--help] [--version] <command> [<args>]
Get specific command help with urbackupclientctl <command> --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
```
## License
**dirconfig** is licensed under the MIT License. See the `LICENSE` file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/judahpaul16/dirconfig",
"name": "dirconfig",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Judah Paul",
"author_email": "me@judahpaul.com",
"download_url": "https://files.pythonhosted.org/packages/97/d2/cc2e63e4a29781b80cdc88fe61a5285b8fd888f7726c63a092ce84ca943b/dirconfig-0.2.6.tar.gz",
"platform": null,
"description": "# dirconfig \ud83d\udcc2\n\n[![PyPI](https://img.shields.io/pypi/v/dirconfig)](https://pypi.org/project/dirconfig/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dirconfig)\n[![PyPI - License](https://img.shields.io/pypi/l/dirconfig)](LICENSE)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/judahpaul16/dirconfig/workflow.yaml)](https://github.com/judahpaul16/dirconfig/actions)\n\n Configure what files should be in what folders using an easy-to-read YAML config file.\n\n## Features\n\n- [x] **File Organization**: Automatically move files based on their extension from one directory to another.\n- [x] **Automated Backups**: Set up scheduled backups for important directories using [urbackup](https://github.com/uroni/urbackup-server-python-web-api-wrapper).\n- [ ] **Notification System**: Get notified regarding specific events specified in the configuration file.\n\n## Installation\n\nInstall **dirconfig** using pip:\n\n```sh\npip install dirconfig\n```\n\n## Configuration\n\nCreate a `config.yml` file in your working directory with your automation tasks. Here's an example configuration that organizes `.jpg` and `.pdf` files into separate directories:\n\n```yaml\ntasks:\n - name: Organize Downloads\n type: file-organization\n source: /path/to/your/source/directory\n rules:\n - extension: .jpg\n destination: /path/to/your/destination/for/images\n - extension: .pdf\n destination: /path/to/your/destination/for/documents\nbackup:\n - name: Backup Important Files\n type: incremental-file # incremental-image, full-file, full-image\n schedule: daily # weekly, monthly\n retention: 7 # number of days to keep backups\n connection:\n server: http://your-backup-server:55414\n username: foo\n password: bar\n directories:\n - /path/to/your/important/directory\n - /path/to/another/important/directory\n```\n\n## Usage\n\n**dirconfig** is designed to run as a daemon, monitoring specified directories and automatically organizing files according to the configurations defined in your `config.yml` file.\n\nYou can generate a sample `config.yml` file using the following command:\n\n```sh\ndirconfig generate\n```\n\n### Starting dirconfig\n\nTo initiate **dirconfig** and begin the monitoring process, use the following command:\n\n```sh\ndirconfig start\n```\n\nThis command starts **dirconfig**, which operates in the background. It will watch the source directories specified in your `config.yml` for any changes, organizing files according to your predefined rules.\n\nAlternatively, to run **dirconfig** as a separate process, use the following command:\n\n```sh\ndirconfig start &\n```\n\n### Stopping dirconfig\n\nTo stop the **dirconfig** daemon, execute:\n\n```sh\ndirconfig stop\n```\nThis command stops the background process of **dirconfig**, halting the monitoring and file organization tasks.\n\n### Command Line Options\n```sh\nusage: dirconfig [-h] [--config CONFIG] [--log LOG] [--pid PID] {start,stop,generate}\n\ndirconfig Daemon\n\npositional arguments:\n {start,stop,generate}\n Dirconfig actions to perform\n\noptions:\n -h, --help show this help message and exit\n --config CONFIG Path to the configuration file\n --log LOG Path to the log file\n --pid PID Path to the PID file\n```\n\n### Advanced Management\n\nFor long-term operation or deployment, integrating **dirconfig** with system services or process managers can offer more graceful management, including automatic restarts, logging, and simplified start/stop operations.\n\n## Extending dirconfig\n\n**dirconfig** welcomes enhancements and customization. If you're interested in adding new features or improving the tool, consider contributing to the source code. Your input and contributions are highly appreciated.\n\n## Urbackup Documentation\nFor more information on the Urbackup API, please refer to these resources:\n* *[Urbackup Python API Wrapper](https://github.com/uroni/urbackup-server-python-web-api-wrapper)*\n* *[Urbackup Backend ClientCTL](https://github.com/uroni/urbackup_backend/tree/dev/clientctl)*\n\n*Important Note: For Windows the command-line tool is `urbackupclient_cmd`. Mac and Linux use `urbackupclientctl`.\n\nCommand Line Options for `urbackupclientctl` are as follows:\n\n```sh\nUSAGE:\n\n urbackupclientctl [--help] [--version] <command> [<args>]\n\nGet specific command help with urbackupclientctl <command> --help\n\n urbackupclientctl start\n Start an incremental/full image/file backup\n\n urbackupclientctl status\n Get current backup status\n\n urbackupclientctl browse\n Browse backups and files/folders in backups\n\n urbackupclientctl restore-start\n Restore files/folders from backup\n\n urbackupclientctl set-settings\n Set backup settings\n\n urbackupclientctl reset-keep\n Reset keeping files during incremental backups\n\n urbackupclientctl add-backupdir\n Add new directory to backup set\n\n urbackupclientctl list-backupdirs\n List directories that are being backed up\n\n urbackupclientctl remove-backupdir\n Remove directory from backup set\n```\n\n## License\n\n**dirconfig** is licensed under the MIT License. See the `LICENSE` file for more details.\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple directory configuration tool",
"version": "0.2.6",
"project_urls": {
"Homepage": "https://github.com/judahpaul16/dirconfig"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "763e6b8e523473f4308354268b0d32d16c2505f11e21441c3410e3c0a8c49a2a",
"md5": "d14b14fc942f02d5bf8306540a8c8ba9",
"sha256": "5eb2b4d932caa859a1637c3832bf1118aac6eaefb8165b821e0655c57fb312c6"
},
"downloads": -1,
"filename": "dirconfig-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d14b14fc942f02d5bf8306540a8c8ba9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9764,
"upload_time": "2024-04-27T20:32:02",
"upload_time_iso_8601": "2024-04-27T20:32:02.410364Z",
"url": "https://files.pythonhosted.org/packages/76/3e/6b8e523473f4308354268b0d32d16c2505f11e21441c3410e3c0a8c49a2a/dirconfig-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97d2cc2e63e4a29781b80cdc88fe61a5285b8fd888f7726c63a092ce84ca943b",
"md5": "95715325049f1aafa64232da31f2ac4e",
"sha256": "ffd19802e2733cbad9bb5c148608a4555895d0b5e5d4a2180095cec84a8e76f4"
},
"downloads": -1,
"filename": "dirconfig-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "95715325049f1aafa64232da31f2ac4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9138,
"upload_time": "2024-04-27T20:32:03",
"upload_time_iso_8601": "2024-04-27T20:32:03.949881Z",
"url": "https://files.pythonhosted.org/packages/97/d2/cc2e63e4a29781b80cdc88fe61a5285b8fd888f7726c63a092ce84ca943b/dirconfig-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-27 20:32:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "judahpaul16",
"github_project": "dirconfig",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "dirconfig"
}