{"id":24990023,"url":"https://github.com/secynic/proc_wrapper","last_synced_at":"2025-08-09T05:09:09.611Z","repository":{"id":26642825,"uuid":"30098789","full_name":"secynic/proc_wrapper","owner":"secynic","description":"proc_wrapper is a simple bash script for wrapping commands with process control and logging. It works well with cron and managing hung processes e.g., kill, restart.","archived":false,"fork":false,"pushed_at":"2016-04-01T00:01:12.000Z","size":10,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T05:58:37.238Z","etag":null,"topics":["bash-script","bsd-license","cron","linux","process-manager","unix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secynic.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-31T01:49:02.000Z","updated_at":"2023-10-22T08:24:11.000Z","dependencies_parsed_at":"2022-09-01T18:53:25.926Z","dependency_job_id":null,"html_url":"https://github.com/secynic/proc_wrapper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/secynic/proc_wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secynic%2Fproc_wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secynic%2Fproc_wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secynic%2Fproc_wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secynic%2Fproc_wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secynic","download_url":"https://codeload.github.com/secynic/proc_wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secynic%2Fproc_wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269532365,"owners_count":24433271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","bsd-license","cron","linux","process-manager","unix"],"created_at":"2025-02-04T13:04:21.616Z","updated_at":"2025-08-09T05:09:09.546Z","avatar_url":"https://github.com/secynic.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"============\nproc_wrapper\n============\n\nproc_wrapper is a simple bash script for wrapping commands with process\ncontrol and logging. It works well with cron and managing hung processes\ne.g., kill, restart.\n\nFeatures\n========\n\n* Control the run time of processes.\n* Lock commands by name to avoid duplicate processes.\n* Can be used with cron or directly.\n* Logging\n* BSD license\n\nUsage\n=====\n\nCommand::\n\n  proc_wrapper.sh [-c '\u003cstring\u003e'] [-n \u003cstring\u003e] [-a] [-t \u003cint\u003e] [-ld \u003cdir\u003e]\n    [-td \u003cdir\u003e] [-d] [-v]\n\nOptions::\n\n  -c|--command '\u003cstring\u003e' : Command (required)\n    The command to run. Must be in single quotes.\n\n  -n|--name '\u003cstring\u003e' : Unique name (required)\n    A unique name string used to identify this command. Needed for process\n    tracking, log file names, and duplicate command support. Must be in quotes.\n\n  -a|--active : Toggle active\n    When set, this script remains active throughout the duration of the process\n    or timeout. Disabled by default. Generally, this option should not be used\n    when running via scheduled jobs e.g., cron.\n\n  -t|--timeout \u003cint\u003e : Timeout (seconds)\n    The maximum amount of seconds the command is allowed to run. The default\n    value is 0, which does not set a time constraint on the command. Generally,\n    this value should be greater than the scheduled interval when running via\n    jobs e.g., cron.\n\n  -ld|--logdir \u003cdir\u003e : Log directory path\n    The path of the directory used to store log files. The default directory is\n    /var/log.\n\n  -td|--tempdir \u003cdir\u003e : Temp directory path\n    The path of the temp directory used to store pid files. The default\n    directory is /tmp.\n\n  -d|--debug : Debug\n    When set, verbose logging is enabled. Disabled by default.\n\n  -v|--version : Version\n    Prints the script version and exits.\n\nUsage Examples\n==============\n**In the below examples, '/home/uname' is used as the example user directory.\nMake sure to follow hardening standards for locations, permissions, etc.**\n\n|\n\nPython script with 180s timeout, active enabled, and directories::\n\n  cd /home/uname/proc_wrapper\n  ./proc_wrapper.sh -c '/usr/local/bin/python /home/uname/myproj/script.py' -n\n    'myproj' -a -t 180 -ld /home/uname/myproj/log -td /home/uname/myproj/tmp\n\nThe above in cron, run every minute (**-a is not used here**)::\n\n  crontab -e\n  * * * * * /home/uname/proc_wrapper/proc_wrapper.sh -c '/usr/bin/python -u\n    /home/uname/myproj/script.py' -t 180 -ld /var/log/myproj -td /tmp/myproj \u003e\u003e\n    /var/log/myproj-cron.log 2\u003e\u00261\n\nShow the proc_wrapper version::\n\n  cd /home/uname/proc_wrapper\n  ./proc_wrapper.sh -v\n\nInstalling\n==========\n\nRetrieve the latest version::\n\n  cd /tmp\n  wget https://github.com/secynic/proc_wrapper/tarball/master\n\nCopy proc_wrapper files to some folder::\n\n  tar -zxvf master -C /home/uname/proc_wrapper --strip-components=1\n  chmod u+x /home/uname/proc_wrapper","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecynic%2Fproc_wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecynic%2Fproc_wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecynic%2Fproc_wrapper/lists"}