How to exclude an entire directory from Android 6 Auto Backup? -
i'd configure android 6 auto backup feature exclude files in entire directories (both in "files" , "external"), specific extensions should excluded. wildcards . , *.tn-png work path value? cannot explicitly define files since these created @ run-time.
android:fullbackupcontent="@xml/mybackupscheme"
where mybackupscheme example this:
<?xml version="1.0" encoding="utf-8"?> <full-backup-content> <exclude domain="file" path="device-links.xml"/> <exclude domain="file" path="*.tn-png"/> <exclude domain="file" path="links/*.*"/> <exclude domain="external" path="external-links/*.*" /> </full-backup-content>
thanks in advance,
the official documentation says:
path: specifies file or folder include in or exclude backup. note that: this attribute not support wildcard or regex syntax.
so can't use wildcards.
but can use exclude
exclude entire directories
<exclude>
- specifies file or folder exclude during backup.
if have complex file structure, can implement own backupagent
, overide onfullbackup
method.
you can't express set of files want backup xml rules. in these rare cases, can implement backupagent overrides onfullbackup(fullbackupdataoutput) store want. retain system's default implementation, call corresponding method on superclass super.onfullbackup().
Comments
Post a Comment