This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ash_history [2024/09/24 01:28] – created hommeoursporc | ash_history [2024/10/31 21:52] (current) – hogwild | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | By default the command line history | + | ====== Make command line history persistent |
| - | The commands | + | By default, the command line history is stored as long as you don't reboot/power off the router. However, You can make it persistent by using permanent storage, such as JFFS or USB attached storage. |
| - | We can use FreshTomato ability to execute script at boot and at shutdown to backup and restore the commands | + | The command |
| - | \\ This shutdown script will save the last 100 used commands. If you want to keep more, change ' | + | 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. |
| - | Name your backup script | + | |
| + | | ||
| <code bash cli_history_save.autostop> | <code bash cli_history_save.autostop> | ||
| Line 14: | Line 15: | ||
| </ | </ | ||
| - | \\ The second script will restore the history when booting.\\ Name your restore script | + | |
| <code bash cli_history_restore.autorun> | <code bash cli_history_restore.autorun> | ||
| Line 22: | Line 23: | ||
| </ | </ | ||
| - | \\ Make sure to place the scripts in the storage | + | \\ \\ You must place the scripts in the mounted |
| <code bash> | <code bash> | ||
| chmod +x cli_history_save.autostop cli_history_restore.autorun | chmod +x cli_history_save.autostop cli_history_restore.autorun | ||
| </ | </ | ||
| + | |||
| + | \\ \\ \\ | ||