Automate git commands for ""Generate archive" to download a tar archive of the current configuration files"

Hi

At the moment I create a backup of my changes (maybe I need a rollback) with:

Then I "upload" it manually to Git Repo.

Is there a LuCI module or other hint to automate that process?

I'm not sure about WubUI automation, but you can use CLI:

cd openwrt-backup.git
ssh root@openwrt.lan 'umask go=; sysupgrade -b /tmp/backup-${HOSTNAME}-$(date +%F).tar.gz'
scp root@openwrt.lan:/tmp/backup-*.tar.gz .
ssh root@openwrt.lan 'rm -f /tmp/backup-*.tar.gz'
tar -z -x -f backup-*.tar.gz
rm -f backup-*.tar.gz
git push --force
cd -
2 Likes

thank you. That's nice.

1 Like