How to exclude files or directories in Webmin > System > Filesystem Backup?
Webmin 1.9.4.2 | Ubuntu server 18.01.3 | Virtualmin 6.09 | Theme 19.47
Main drive: /dev/sda2 - 120 GB SSD (14 GB in use)
Backup drive: /dev/sdb2 - 2 TB drive(30% in use) mapped to /media/backup
Directory to backup: /
Filesystem: TAR
Backup to: /media/backup/Webmin/2020-05-12_Filesystem.tar
Results with various “Files and directories to skip”:
Backup file grows beyond 14GB (processed stopped at sizes up to 200+ GB) if exclusion is
/media/backup, or
media/backup
Backup exits with failure at 14GB if more folders are added, separated by spaces
(e.g., media/backup proc). Usual final message refers to “errors above” or something similar.
Virtualmin → Backup and Restore → Scheduled Backups / Backup Virtual Servers
There you can customize the settings. I assume the exclude are needed like this:
Excluding
/media/backup/*
does not work. I terminated the process at 41G.
Note that your suggestion is based on the backup in the Virtualmin area, while the one I am using is under Webmin. Also, the instructions to exclude in Virtualmin say to put each exclusion on a separate line. The instructions in the info pop-up for the Webmin Filesystem backup say to separate the exclusions with a space.
Its possible that either a process interferes or there are timeouts in the scripts.
Without further information, its not really easy to help at some point.
It looks this will not be resolved. I am still unable to do a Filesystem Backup to an attached, mounted drive and exclude other directories on that drive.
BTW, perhaps I should have made it explicit earlier that the system is local; it is not on a VPS.
Settings for the work-around I am using are below. Note that this is doable only because the backup file is smaller than the unused space on the server.
Directory to backup: /
Filesystem: TAR
Backup to: /home/Filesystem.tar.gz
Backup options
Files and directories to skip: [blank]
Compress archive with gzip
Extra command-line parameters: --exclude-from=/home/Filesystem-exclude
Filesystem-exclude contents:
home/Filesystem.tar.gz
proc
sys
dev
boot
lib
media
mnt
Procedure:
Unmount the secondary drive (System > Disk and Network Filesystems > …)
Run Filesystem Backup
(Re)Mount the attached drive
Move the backup file, Filesystem.tar.gz to the attached backup drive. (I rename it with the date of the backup.)
Maybe the above will be of use to someone else having issues with skipping files in a Filesystem Backup.