Hi,
I am using OpenWrt for some time, with few previous versions. In all versions before 24.10, I been generating Backup file in, which is by default provided in TAR.GZ format.
If needed, I could extract backup file and read content of each file from there.
This worked well untill 23.05. After upgrading to 24.10, none of the files extracting now. I am using macOS and build in extracter, tried as well with The Unarchiver and Keka. None of the files are exteactable now.
Typically TAR.GZ extract files, but now its just generating folder with TAR file, and TAR file cannot be further extracted.
What browser are you using to download the backup file. Safari may be stripping the .gz from the download if you allow it to open “safe” files. This could cause the behavior you are experiencing.
For what its worth, I just performed a backup from one of my OpenWrt devices, via Safari on Mac and I had no problem whatsoever opening the tar.gz file that resulted.
Tested on a Mac Mini M4 Pro with Sequoia 15.5. I don't have the Unarchiver app installed on this machine, but I extracted the files in two different ways.
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
/etc/ssl/
/etc/wireguard/
/etc/cloudflared/
/etc/sysctl.d/
/etc/init.d/
/etc/config/
/etc/init.d/
/root/
but also tried with default
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
There are some unusual/non-standard things included in your backup... the one that raises eyebrows is this one:
Normally all of the wireguard configs live inside the /etc/config/network file.
The rest are just not necessary to backup unless there are specific additions/edits you've made to those files that might not be picked up in a normal backup.
All that said....
and it still didn't work??
I have just run backups on 2 more devices and unpacked them with a simple double-click on my Mac. No issues whatsoever. (all of the devices are running 24.10.2). I've attached one of the devices' backups (it's a completely default config, no personal information) -- try downloading it and see if your computer opens it. If it doesn't open, something is wrong on your Mac. (and if it does open, that suggests something is wrong with your OpenWrt device.)
It is good that we've now eliminated Mac/Windows from the equation.
The file I provided is from 24.10.2, just as yours. So there's no obvious reason why yours is creating invalid files while mine is okay.
Probably more important will be to understand the details of your devices. Specifically, have you added packages and/or removed any? And what have you changed in your configs that would be less common?
Critically, can OpenWrt read the file it created to restore your config?
I just reset askey rt4230w-rev6 and tried various things, installing various packages and doing things that I am typically doing or intalling on main device, and backup is working well, no issues.
I struggling to understand whats wrong.
I think its something that I installed/added manually to router that causing this on my device.
I will try to re-set and setup all again and see at what stage is generating corrupted backup file.
I will need to investigate how to generate backup from terminal rather than luci do see if thats throing any errors.
# tar -zxvf backup-MX4200v2-2025-07-03.tar.gz
tar: invalid tar magic
installed tar package opkg install tar
and now got
root@MX4200v2:/tmp/test# tar -zxvf backup-MX4200v2-2025-07-03.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
and thats directly on the router.
May be related?
as stated here
This command:
sysupgrade -l | tar -czf backup.tar.gz -T -
Produce backup in valid TAR.GZ that can be extracted correctly.