Create/restore backup archive from CLI

What is the CLI syntax to generate the same tar.gz config archive made in LuCI (e.g. to use the file list, etc. that LuCI does)?

Also, if it's possible, can the command the archive to /tmp

(I've search and looked for this specific answer for years; and just never asked - feel free to post a link to a relevant thread if one exists. :blush: )

Also, what's the command to restore the archive from the CLI?

sysupgrade -b /tmp/backup-${HOSTNAME}-$(date +%F).tar.gz

        -r | --restore-backup <file>
                     restore a .tar.gz created with sysupgrade -b
                     then exit. Does not flash an image. If file is '-',
                     the archive is read from stdin.
2 Likes

Just to add onto this, sysupgrade -h is the magic bullet:

# sysupgrade -h
[…]
        -b | --create-backup <file>
                     create .tar.gz of files specified in sysupgrade.conf
                     then exit. Does not flash an image. If file is '-',
                     i.e. stdout, verbosity is set to 0 (i.e. quiet).
[…]
1 Like

Cool!

Thanks!

I never knew (vaguely recalled) that was a part of the sysupgrade program (woulda never thought to do -h on that program)!

I was trying to search anything that had tar.gz - and was getting a lot of results.


(thought to self: So gzip is a part of busybox? Interesting, cause I don't have that installed anywhere.)

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.