dieyoung


Namedieyoung JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryFind (and kill) long running processes by name and arguments
upload_time2024-08-29 10:58:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords filter find inspect kill long time monitoring old process ps slow smart
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dieyoung
Find / kill very long running processes by name, args and age

## Installation
recommended way:
`pipx install dieyoung`

or (better if inside python virtualenv):
`pip install dieyoung`
your system may have `pip3` instead of `pip`.

## Find processes by name / arguments, three different modes
See all my ssh sessions:
~~~shell
$ dieyoung ssh
732333 8h ssh alv
742297 7h ssh jul
745335 6h ssh mx
875490 38m ssh -i /home/xenon/.ssh/id_ed25519 mx
880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519
~~~
Format is simple: pid, age, cmdline

Now, lets suppose we want to find only ssh to mx:
~~~shell
$ dieyoung ssh mx
745335 6h ssh mx
875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx
880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519
~~~
Three sessions are found, because each of them has "ssh" and "mx" in cmdline (in any order). This is how `--mode any` works (default mode), processes matches our pattern if all words from pattern are found *anywhere* in process cmdline, even if there are other arguments.

`--mode start`: First words of cmdline must match pattern, e.g. 
~~~shell
$ dieyoung -m start -- ssh -i 
875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx
~~~
But this filter will not find process `ssh mx -i /home/xenon/.ssh/id_ed25519` (because `ssh mx` is not `ssh -i`). 
Note, we used `--` to separate PATTERN (`ssh -i`) from dieyoung arguments.

`--mode full`: process cmdline must fully match pattern, e.g.
~~~shell
$ dieyoung -m full -- ssh -i /home/xenon/.ssh/id_ed25519 mx
875490 40m ssh -i /home/xenon/.ssh/id_ed25519 mx
~~~

## Filter by age, user and executable
To find processes older then some age use `-a` / `--age` option, like `-a 1h30m` (to find processes older then 1 hour and 30minutes)

`--exe PATH` to find only processes with this executable, e.g. if you want to find `/usr/bin/php` but not `/opt/php/7.4/bin/php`.

`--user USERNAME` to find only processes of this user. 


## Kill / Terminate processes
After you found processes, you may kill it manually with `kill` command, or use built-in feature. Add `--terminate` option to gracefully send SIGTERM to each matching process or `--kill` to send `SIGKILL` (like `kill -9 <pid>`).

## Inspect more details of processes
Add `-j` / `--json` to show more info about processes




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dieyoung",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "filter, find, inspect, kill, long time, monitoring, old, process, ps, slow, smart",
    "author": null,
    "author_email": "Yaroslav Polyakov <yaroslaff@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c5/c8/403faed9ce7e3c37342807a18ee7ebe57238d3b11d57f1ba01056b310dd2/dieyoung-0.0.2.tar.gz",
    "platform": null,
    "description": "# dieyoung\nFind / kill very long running processes by name, args and age\n\n## Installation\nrecommended way:\n`pipx install dieyoung`\n\nor (better if inside python virtualenv):\n`pip install dieyoung`\nyour system may have `pip3` instead of `pip`.\n\n## Find processes by name / arguments, three different modes\nSee all my ssh sessions:\n~~~shell\n$ dieyoung ssh\n732333 8h ssh alv\n742297 7h ssh jul\n745335 6h ssh mx\n875490 38m ssh -i /home/xenon/.ssh/id_ed25519 mx\n880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519\n~~~\nFormat is simple: pid, age, cmdline\n\nNow, lets suppose we want to find only ssh to mx:\n~~~shell\n$ dieyoung ssh mx\n745335 6h ssh mx\n875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx\n880910 25m ssh mx -i /home/xenon/.ssh/id_ed25519\n~~~\nThree sessions are found, because each of them has \"ssh\" and \"mx\" in cmdline (in any order). This is how `--mode any` works (default mode), processes matches our pattern if all words from pattern are found *anywhere* in process cmdline, even if there are other arguments.\n\n`--mode start`: First words of cmdline must match pattern, e.g. \n~~~shell\n$ dieyoung -m start -- ssh -i \n875490 39m ssh -i /home/xenon/.ssh/id_ed25519 mx\n~~~\nBut this filter will not find process `ssh mx -i /home/xenon/.ssh/id_ed25519` (because `ssh mx` is not `ssh -i`). \nNote, we used `--` to separate PATTERN (`ssh -i`) from dieyoung arguments.\n\n`--mode full`: process cmdline must fully match pattern, e.g.\n~~~shell\n$ dieyoung -m full -- ssh -i /home/xenon/.ssh/id_ed25519 mx\n875490 40m ssh -i /home/xenon/.ssh/id_ed25519 mx\n~~~\n\n## Filter by age, user and executable\nTo find processes older then some age use `-a` / `--age` option, like `-a 1h30m` (to find processes older then 1 hour and 30minutes)\n\n`--exe PATH` to find only processes with this executable, e.g. if you want to find `/usr/bin/php` but not `/opt/php/7.4/bin/php`.\n\n`--user USERNAME` to find only processes of this user. \n\n\n## Kill / Terminate processes\nAfter you found processes, you may kill it manually with `kill` command, or use built-in feature. Add `--terminate` option to gracefully send SIGTERM to each matching process or `--kill` to send `SIGKILL` (like `kill -9 <pid>`).\n\n## Inspect more details of processes\nAdd `-j` / `--json` to show more info about processes\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Find (and kill) long running processes by name and arguments",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/yaroslaff/dieyoung",
        "Issues": "https://github.com/yaroslaff/dieyoung/issues"
    },
    "split_keywords": [
        "filter",
        " find",
        " inspect",
        " kill",
        " long time",
        " monitoring",
        " old",
        " process",
        " ps",
        " slow",
        " smart"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ee0c41631453800c365dbd0025beff9053b372db8dc1de9d2b3f9c4d23472f99",
                "md5": "4f44deb82cfdd0bbe4a6cc0ec8d8ed73",
                "sha256": "dd4bdc14c36bd1642c06d43d206bd2cd6923b07cc2114196ebe74f0edf0f5a60"
            },
            "downloads": -1,
            "filename": "dieyoung-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4f44deb82cfdd0bbe4a6cc0ec8d8ed73",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5125,
            "upload_time": "2024-08-29T10:58:17",
            "upload_time_iso_8601": "2024-08-29T10:58:17.733514Z",
            "url": "https://files.pythonhosted.org/packages/ee/0c/41631453800c365dbd0025beff9053b372db8dc1de9d2b3f9c4d23472f99/dieyoung-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c5c8403faed9ce7e3c37342807a18ee7ebe57238d3b11d57f1ba01056b310dd2",
                "md5": "bd867d15b10f4902766dd799f4c260c9",
                "sha256": "072c741f9d1eb961abcd3ef1d039210c3b9bb045c2570f8335e70e9ec611d3de"
            },
            "downloads": -1,
            "filename": "dieyoung-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "bd867d15b10f4902766dd799f4c260c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5780,
            "upload_time": "2024-08-29T10:58:16",
            "upload_time_iso_8601": "2024-08-29T10:58:16.616863Z",
            "url": "https://files.pythonhosted.org/packages/c5/c8/403faed9ce7e3c37342807a18ee7ebe57238d3b11d57f1ba01056b310dd2/dieyoung-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-29 10:58:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yaroslaff",
    "github_project": "dieyoung",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dieyoung"
}
        
Elapsed time: 0.94354s