This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ash_history [2024/10/31 21:52] – hogwild | ash_history [2026/07/27 16:04] (current) – hogwild | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Make command line history persistent ====== | ====== Make command line history persistent ====== | ||
| - | By default, the command line history is stored as long as you don't reboot/ | + | By default, the command line history is stored as long as you don't reboot/ |
| The command history is kept in: "/ | The command history is kept in: "/ | ||
| - | FreshTomato can execute a script at boot and at shutdown to backup and restore the command history to make it persistent across reboots. To achieve this, we need 2 scripts. One script will execute at shutdown to backup the history to permanent storage. The other will restore the history on boot. | + | FreshTomato can execute a script at boot and at shutdown to backup and restore the command history to make it persistent across reboots. To achieve this, we need two scripts. One script will execute at shutdown to backup the history to permanent storage. The other will restore the history on boot. |
| \\ \\ This shutdown script will save the last 100 commands used. \\ To save more, change ' | \\ \\ This shutdown script will save the last 100 commands used. \\ To save more, change ' | ||
| + | |||
| + | \\ | ||
| <code bash cli_history_save.autostop> | <code bash cli_history_save.autostop> | ||
| Line 16: | Line 18: | ||
| \\ \\ The second script will restore the command history when booting.\\ Name your restore script " | \\ \\ The second script will restore the command history when booting.\\ Name your restore script " | ||
| + | |||
| + | \\ | ||
| <code bash cli_history_restore.autorun> | <code bash cli_history_restore.autorun> | ||
| Line 24: | Line 28: | ||
| \\ \\ You must place the scripts in the mounted storage directory, | \\ \\ You must place the scripts in the mounted storage directory, | ||
| + | |||
| + | \\ | ||
| <code bash> | <code bash> | ||
| chmod +x cli_history_save.autostop cli_history_restore.autorun | chmod +x cli_history_save.autostop cli_history_restore.autorun | ||
| </ | </ | ||
| - | |||
| - | \\ | ||
| \\ \\ \\ | \\ \\ \\ | ||