Site Tools


backup_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
backup_script [2025/04/25 15:50] – typos and minor iomprovements thilobackup_script [2025/04/28 18:23] (current) – [Goals] hogwild
Line 11: Line 11:
  \\  \\
  
-The script in the code window on this page will create and download the bckup without needing to have SFTP enabled on the router.+The script at the bottom of this page will create and download the backup without needing to have SFTP enabled on the router.
  
- \\ One option would be to create the backup as a cron job on the router itself. Then, in a second step, use the mechaism 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  is covered by the script.+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 scriptTo achieve this, the script covers creation of the backup in an individual file with timestamp and download.
  
-In this way, just one run of the script on the backup server would 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.
  
 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 "//nvram save//" command. This is how backups are done in the web interface. + \\ \\ The backup is created using the "//nvram save//" command. This is how backups are done "under the hood" in the web interface.
  
-You may cross-check that the backups are identical to the ones via web  interface by a) download backup via GUI b) create backup by script, c) copy both files to router d) convert both files by "nvram convert <filename1/2>  > result_file1/2.txt e) diff the two resulting text files. (I believe this cross check hints are obsolete....?!?!?)+You may cross-check that the backups are identical to the ones via the GUI using the following steps:
  
-The script then archives the resulting data in a tar file and sends it through the netcat command, which transfers it over the network.+ \\
  
-A configurable number of backups is kept, older ones are deleted.+  - Download the backup via the graphical interface 
 +  - Create a backup via a script 
 +  - Copy both files to router 
 +  - Convert both files via the command "//nvram convert// <filename1/2>  > result_file1/2.txt" 
 +  - Perform a diff between the two resulting text files.
  
  \\  \\
  
-Prerequisites:+The script then archives the resulting data in a tar file and sends it through the netcat command, transferring it over the network. 
 + 
 +A configurable number of backups is kept. Older ones are deleted. 
 + 
 + \\ 
 + 
 + 
 +==== Prerequisites ====
  
  \\  \\
backup_script.1745592644.txt.gz · Last modified: 2025/04/25 15:50 by thilo