I know there's a lot of posts about this, as well as the Wiki, but I can't seem to get the exact behavior I want.
Essentially, how can I preserve a subdirectory but update the outer directory during reflashing with sysupgrade?
Suppose I had /root/data, with /root/data/file1, /root/data/file2, etc.
During a flash I want to update all files inside /root, but preserve the data folder.
I first tried placing /root/data/ in base-files, then doing sysupgrade -n or just sysupgrade. Without the -n flag everything was kept, and -n erased /root/data
I then tried using base-files-essential, appending /root/data/ to the end, and using the -n flag, to no avail.
I'm aware I could do
! dont/keep/this
! dont/keep/this/either
But I'm looking for a better way. Any help is greatly appreciated
By defining those files or that directory in /etc/sysupgrade.conf
For example, I am preserving the /etc/backup.stats directory (while the other files & dirs in /etc get handled quite normally in sysupgrade)
root@router5:~# cat /etc/sysupgrade.conf
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
/etc/backup.stats