{"id":16366390,"url":"https://github.com/centminmod/scriptreplay","last_synced_at":"2026-02-17T06:30:17.376Z","repository":{"id":80280056,"uuid":"529096320","full_name":"centminmod/scriptreplay","owner":"centminmod","description":"script and scriptreplay wrapper script","archived":false,"fork":false,"pushed_at":"2022-08-27T07:25:24.000Z","size":714,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T01:28:58.064Z","etag":null,"topics":["script","scriptreplay","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-26T03:08:47.000Z","updated_at":"2024-12-13T06:54:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"699fef75-e584-4b9e-91b3-77e0712e40be","html_url":"https://github.com/centminmod/scriptreplay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fscriptreplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fscriptreplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fscriptreplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fscriptreplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/scriptreplay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239827776,"owners_count":19703749,"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","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":["script","scriptreplay","ssh"],"created_at":"2024-10-11T02:46:19.035Z","updated_at":"2026-02-17T06:30:17.340Z","avatar_url":"https://github.com/centminmod.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[script/scriptreplay](https://www.redhat.com/sysadmin/record-terminal-script-scriptreplay) wrapper script which allows you to record your SSH terminal commands and session and replay them. The resulting recorded plain text typescript based files are saved as gzip compressed `cmds.gz` and `time.txt.gz` files to save disk space and allows replaying of the saved compressed files via this wrapper script.\n\nThis wrapper script uses `script` and `scriptreplay` commands.\n\n```\nscript --help\n\nUsage:\n script [options] [file]\n\nMake a typescript of a terminal session.\n\nOptions:\n -a, --append                  append the output\n -c, --command \u003ccommand\u003e       run command rather than interactive shell\n -e, --return                  return exit code of the child process\n -f, --flush                   run flush after each write\n     --force                   use output file even when it is a link\n -q, --quiet                   be quiet\n -t[\u003cfile\u003e], --timing[=\u003cfile\u003e] output timing data to stderr or to FILE\n -h, --help                    display this help\n -V, --version                 display version\n\nFor more details see script(1).\n```\n\n```\nscriptreplay --help\n\nUsage:\n scriptreplay [-t] timingfile [typescript] [divisor]\n\nPlay back terminal typescripts, using timing information.\n\nOptions:\n -t, --timing \u003cfile\u003e     script timing output file\n -s, --typescript \u003cfile\u003e script terminal session output file\n -d, --divisor \u003cnum\u003e     speed up or slow down execution with time divisor\n -m, --maxdelay \u003cnum\u003e    wait at most this many seconds between updates\n -h, --help              display this help\n -V, --version           display version\n\nFor more details see scriptreplay(1).\n```\n\n# Installation\n\nYou can download the `script-record.sh` script and make it executable and run it that way. Or save it a globally executable command:\n\n```\ncurl -sL https://github.com/centminmod/scriptreplay/raw/master/script-record.sh -o /usr/local/bin/script-record\nchmod +x /usr/local/bin/script-record\n```\n```\nscript-record \n\nUsage:\n\n/usr/local/bin/script-record rec SESSION_NAME\n/usr/local/bin/script-record play /path/to/cmds.gz /path/to/time.txt.gz\n/usr/local/bin/script-record play /path/to/cmds.gz /path/to/time.txt.gz 2\n/usr/local/bin/script-record play-nogz /path/to/cmds /path/to/time.txt\n/usr/local/bin/script-record play-nogz /path/to/cmds /path/to/time.txt 2\n/usr/local/bin/script-record list\n```\n\n# Update\n\nUpdating globally executable command is the same installation:\n\n```\ncurl -sL https://github.com/centminmod/scriptreplay/raw/master/script-record.sh -o /usr/local/bin/script-record\nchmod +x /usr/local/bin/script-record\n```\n\n# Usage\n\n* rec - enter your SESSION_NAME. If you do not pass a session name, the script will automatically name the session as `session`.\n* play - pass the full paths to where the `cmds.gz` and `time.txt.gz` files are saved. You can optionally pass a 3rd arugument for playback speed i.e. pass `2` for [2x playback speed](#replay-speed).\n* play-nogz - pass the full paths to where the uncompressed non-gzip `cmds` and `time.txt` files are saved. You can optionally pass a 3rd arugument for playback speed i.e. pass `2` for [2x playback speed](#replay-speed).\n* list - list all previously saved `cmds.gz` and `time.txt.gz` files.\n\n```\n./script-record.sh\n\nUsage:\n\n./script-record.sh rec SESSION_NAME\n./script-record.sh play /path/to/cmds.gz /path/to/time.txt.gz\n./script-record.sh play /path/to/cmds.gz /path/to/time.txt.gz 2\n./script-record.sh play-nogz /path/to/cmds /path/to/time.txt\n./script-record.sh play-nogz /path/to/cmds /path/to/time.txt 2\n./script-record.sh list\n```\n\n# script record SSH commands\n\nrecord a SSH session named `cmds` which will be saved to date and timestamped directory like `/root/.script/2022-08-25/2022-08-25_23-01-40-cmds1`. If you do not pass a session name, the script will automatically name the session as `session` i.e. `/root/.script/2022-08-25/2022-08-25_23-01-40-session`.\n\n```\n./script-record.sh rec cmds1\n your_ssh_commands\n```\nTo exit and save the recorded session, type `exit` command which will output the where the `cmds.gz` and `time.txt.gz` files are saved and used for scriptreplay playback:\n\n```\nexit\n\nfiles saved:\n/root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/cmds.gz\n/root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/time.txt.gz\n\nto replay 1x speed:\n./script-record play /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/cmds.gz /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/time.txt.gz\n\nto replay 2x speed:\n./script-record play /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/cmds.gz /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/time.txt.gz 2\n```\n\n# scriptreplay replay SSH commands\n\nRunning scriptreplay via play argument when you incorrectly leave out the script saved `cmds.gz` and `time.txt.gz` previously recorded files will also list all previously saved files for easier viewing.\n\n```\n./script-record.sh play\n\nerror: required file path(s) to cmds.gz or time.txt.gz do not exist\n\nexisting files detected:\n/root/.script\n└── /root/.script/2022-08-25\n    └── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1\n        ├── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1/cmds.gz\n        └── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1/time.txt.gz\n\n2 directories, 2 files\n\n\nUsage:\n\n./script-record.sh rec SESSION_NAME\n./script-record.sh play /path/to/cmds.gz /path/to/time.txt.gz\n```\n\n# Replay\n\nProper scriptreplay passing the previously saved `cmds.gz` and `time.txt.gz` files:\n\n```\n./script-record.sh play /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/cmds.gz /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/time.txt.gz\n```\n\n# Replay Speed\n\nPass a 3rd argument for playback speed i.e. 2x speed\n\n```\n./script-record.sh play /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/cmds.gz /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/time.txt.gz 2\n```\n\n![scriptreplay playback](/images/script-record-playback-01.gif)\n\n# list saved files\n\n```\n./script-record.sh list\nsaved files listing:\n\n/root/.script\n└── /root/.script/2022-08-25\n    ├── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1\n    │   ├── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1/cmds.gz\n    │   └── /root/.script/2022-08-25/2022-08-25_22-44-10-cmds1/time.txt.gz\n    ├── /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1\n    │   ├── /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/cmds.gz\n    │   └── /root/.script/2022-08-25/2022-08-25_23-01-40-cmds1/time.txt.gz\n    ├── /root/.script/2022-08-25/2022-08-25_23-40-10-cmds1\n    │   ├── /root/.script/2022-08-25/2022-08-25_23-40-10-cmds1/cmds.gz\n    │   └── /root/.script/2022-08-25/2022-08-25_23-40-10-cmds1/time.txt.gz\n    └── /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1\n        ├── /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/cmds.gz\n        └── /root/.script/2022-08-25/2022-08-25_23-42-06-cmds1/time.txt.gz\n\n5 directories, 8 files\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fscriptreplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fscriptreplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fscriptreplay/lists"}