{ "info": { "author": "flanker", "author_email": "flanker@19pouces.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "UdevBackup\n==========\n\nOn Linux, detects when specified storage devices are connected, then mounts them,\nexecutes a script, unmounts them and tells when it is done (using mail or text to speech).\n\nA config file defines storage devices and the scripts to run.\n\nI wrote this script for a simple offline backup of my server: I just have to turn\nthe external USB drive on and wait for the message (using text to speech) before\nturning it off again. UdevBackup double forks before running the script, so\nthere is no timeout problem with udev and slow scripts.\n\nRequire the \"at\" utility for running long jobs (more than 30 seconds).\n\ninstallation\n------------\n\n sudo pip3 install udevbackup --upgrade\n\nyou need to create a udev rule to launch udevbackup when a new device (with a file system) is connected:\n\n echo 'ACTION==\"add\", ENV{DEVTYPE}==\"partition\", RUN+=\"/usr/local/bin/udevbackup at\"' | sudo tee /etc/udev/rules.d/udevbackup.rules\n udevadm control --reload-rules\n \nIf you only have short jobs, you can use\n\n echo 'ACTION==\"add\", ENV{DEVTYPE}==\"partition\", RUN+=\"/usr/local/bin/udevbackup run\"' | sudo tee /etc/udev/rules.d/udevbackup.rules\n udevadm control --reload-rules\n\n\nconfiguration\n-------------\n\nCreate a .ini config file with a \"main\" section for global options, and another section for each\ntarget partition. The name is not important. All .ini files in /etc/udevbackup are read.\nThese files must use the UTF-8 encoding.\n\nYou can display all available options with the \"help\" command, but .\n\n udevbackup help\n\n Create one or more .ini files in /etc/udevbackup.\n Yellow lines are mandatory.\n [main]\n smtp_auth_user = SMTP user. Default to \"\".\n smtp_auth_password = SMTP password. Default to \"\".\n smtp_server = SMTP server. Default to \"localhost\".\n smtp_from_email = Recipient of the e-mail. Default to \"\".\n smtp_to_email = E-mail address for the FROM: value. Default to \"\".\n use_speech = Use google speech for announcing successes and failures. Default to 0.\n use_stdout = Display messages on stdout. Default to 0.\n use_smtp = Send messages by email (with the whole content of stdout/stderr of your scripts). Default to 0.\n smtp_use_tls = Use TLS (smtps) for emails. Default to 0.\n smtp_use_starttls = Use STARTTLS for emails. Default to 0.\n smtp_smtp_port = The SMTP port. Default to 25.\n\n [example]\n fs_uuid = UUID of the used file system. Check /dev/disk/by-uuid/ before and after having connected your disk to get it.\n command = Command to call for running the script (whose name is passed as first argument). Default to \"bash\".\n script = Content of the script to execute when the disk is mounted. Current working dir is the mounted directory. This script will be copied in a temporary file, whose name is passed to the command.\n stdout = Write stdout to this filename.\n stderr = Write stderr to this filename.\n mount_options = Extra mount options. Default to \"\".\n user = User used for running the script and mounting the disk.Default to \"current user\".\n pre_script = Script to run before mounting the disk. The disk will not be mounted if this script does not returns 0. Default to \"\".\n post_script = Script to run after the disk umount. Only run if the disk was mounted. Default to \"\".\n\nHere is a complete example:\n\n cat /etc/udevbackup/example.ini\n [main]\n smtp_auth_user = user\n smtp_auth_password = s3cr3tP@ssw0rd\n smtp_server = localhost\n use_speech = 1\n use_stdout = 0\n use_smtp = 1\n\n [example]\n fs_uuid = 58EE-7CAE\n script = mkdir -p ./data\n rsync -av /data/to_backup/ ./data/\n\nYou can display the current config:\n\n udevbackup show\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "CeCILL-B", "maintainer": "", "maintainer_email": "", "name": "udevbackup", "package_url": "https://pypi.org/project/udevbackup/", "platform": "", "project_url": "https://pypi.org/project/udevbackup/", "project_urls": null, "release_url": "https://pypi.org/project/udevbackup/1.1.2/", "requires_dist": null, "requires_python": "", "summary": "detects when specified storage devices are connected, mounts them, executes a script, umounts them and tells when it is done.", "version": "1.1.2" }, "last_serial": 4272854, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "55961f3a8797d98da02492dd1affc6d5", "sha256": "82bdbd8a9a4ed5a3ae4c4ebdd3ae89f25f12a2930c3c0ab1cfc808874d747ef9" }, "downloads": -1, "filename": "udevbackup-0.1.tar.gz", "has_sig": false, "md5_digest": "55961f3a8797d98da02492dd1affc6d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19039, "upload_time": "2018-06-04T21:40:30", "url": "https://files.pythonhosted.org/packages/04/87/8cf0c994174cbbf8112ca85e4d8fe3edd1fc16e0e041a224b990de3cfd30/udevbackup-0.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "45abf9afa898b025da1f5dca876e1f8d", "sha256": "250eb1aec8300a0b92283b179739228fdd0b3844f966ca1fee71f112909eca23" }, "downloads": -1, "filename": "udevbackup-1.0.tar.gz", "has_sig": false, "md5_digest": "45abf9afa898b025da1f5dca876e1f8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22080, "upload_time": "2018-06-05T05:08:40", "url": "https://files.pythonhosted.org/packages/3f/e4/59ada857cb321c0d5fff0f8ddf7151e21035674f6c4a953c52fa0376dba0/udevbackup-1.0.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "abac469fa66298f24facdc010e425f6d", "sha256": "47f7dadace7e0cf2c8ef99f76c17ee054a7ee96e450096ce03c1a307cc9d9197" }, "downloads": -1, "filename": "udevbackup-1.0.3.tar.gz", "has_sig": false, "md5_digest": "abac469fa66298f24facdc010e425f6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22762, "upload_time": "2018-09-02T13:07:06", "url": "https://files.pythonhosted.org/packages/3e/37/de23e6eb4f5170e0e227bea217890b22f49139fa7fd88947a955a763c924/udevbackup-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "62618ae54797960a2a93dd91eae69a54", "sha256": "6bcb6617afc106a701be4ffb3b9555086b109990e38dd41ef24cd236c7380356" }, "downloads": -1, "filename": "udevbackup-1.0.4.tar.gz", "has_sig": false, "md5_digest": "62618ae54797960a2a93dd91eae69a54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22942, "upload_time": "2018-09-02T15:15:41", "url": "https://files.pythonhosted.org/packages/af/1a/6be2c8c8e59e9b79405439c6e8b886ccde69b2dd99941bf9765fc39a7425/udevbackup-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "2ff4a80115f646623c33c43ddd7639f0", "sha256": "9bb8b62c4932912656b2f49ff5e9d1fbc58079df18447a3eb8bfd00b1f13b95d" }, "downloads": -1, "filename": "udevbackup-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2ff4a80115f646623c33c43ddd7639f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23495, "upload_time": "2018-09-02T20:01:22", "url": "https://files.pythonhosted.org/packages/8e/90/55a157d3f08149e5e429013deff8dc561bf6b931700320bfc6951a12570e/udevbackup-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ebdb277199493e06fad97564ac7f78b7", "sha256": "687959372685254c784c50c071ee3c639e3b8faf9b5488c1963a10233d7af061" }, "downloads": -1, "filename": "udevbackup-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ebdb277199493e06fad97564ac7f78b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16973, "upload_time": "2018-09-02T20:02:03", "url": "https://files.pythonhosted.org/packages/67/fd/e38afff1012e9ff2b13423570fd54ade22547e54799896852b54db36b2de/udevbackup-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "9a4344280c1695f6cde7a2958609bd61", "sha256": "895dfba0d10e65c02ef623e5ab2a5b5ff89b1d73c36fe493477ddad9993b0dc9" }, "downloads": -1, "filename": "udevbackup-1.1.2.tar.gz", "has_sig": false, "md5_digest": "9a4344280c1695f6cde7a2958609bd61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16981, "upload_time": "2018-09-14T15:56:35", "url": "https://files.pythonhosted.org/packages/d8/a3/ff0f0748d7d31b44b8b321d06ff6c33e74bd20adde0c8faad20d0ccda007/udevbackup-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9a4344280c1695f6cde7a2958609bd61", "sha256": "895dfba0d10e65c02ef623e5ab2a5b5ff89b1d73c36fe493477ddad9993b0dc9" }, "downloads": -1, "filename": "udevbackup-1.1.2.tar.gz", "has_sig": false, "md5_digest": "9a4344280c1695f6cde7a2958609bd61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16981, "upload_time": "2018-09-14T15:56:35", "url": "https://files.pythonhosted.org/packages/d8/a3/ff0f0748d7d31b44b8b321d06ff6c33e74bd20adde0c8faad20d0ccda007/udevbackup-1.1.2.tar.gz" } ] }