This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
backup_script [2025/04/28 18:19] – [Goals] -Formatting, condense, grammar hogwild | backup_script [2025/04/28 18:23] (current) – [Goals] hogwild | ||
---|---|---|---|
Line 11: | Line 11: | ||
\\ | \\ | ||
- | The script | + | The script at the bottom of this page will create and download the backup without needing to have SFTP enabled on the router. |
- | We could, of course, create the backup as a cron job on the router itself, and then use the mechanism applied in the script below to download the backup file. However, let's assume you want everything done in just one run. For this reason, creation of the backup in an individual file with timestamp and download | + | We could, of course, create the backup as a cron job on the router itself, and then use the mechanism applied in the script below to download the backup file. However, let's assume you want everything done in just one run of the script. To achieve |
In this way, just one run of the script on the backup server will create the backup and download it to to a safe location. | In this way, just one run of the script on the backup server will create the backup and download it to to a safe location. | ||
Line 19: | Line 19: | ||
Action is based on using a here doc to execute commands on the router. | Action is based on using a here doc to execute commands on the router. | ||
- | \\ | + | |
- | + | ||
- | The backup is created using the "// | + | |
You may cross-check that the backups are identical to the ones via the GUI using the following steps: | You may cross-check that the backups are identical to the ones via the GUI using the following steps: | ||
Line 27: | Line 25: | ||
\\ | \\ | ||
- | a) Download the backup via the graphical interface | + | - Download the backup via the graphical interface |
- | + | | |
- | b) Create a backup via a script | + | |
- | + | | |
- | c) Copy both files to router | + | |
- | + | ||
- | d) Convert both files via the command "nvram convert < | + | |
- | + | ||
- | e) Perform a diff between the two resulting text files. | + | |
\\ | \\ | ||
- | The script then archives the resulting data in a tar file and sends it through the netcat command, | + | The script then archives the resulting data in a tar file and sends it through the netcat command, |
- | A configurable number of backups is kept, older ones are deleted. | + | A configurable number of backups is kept. Older ones are deleted. |
\\ | \\ |