UNIX / Linux Dump Command Exclude Directories / Files

https://w‮ual.ww‬tturi.com
UNIX / Linux Dump Command Exclude Directories / Files

The dump command is a utility for creating backups of file systems on UNIX and Linux systems. To exclude certain directories or files from the backup, you can use the -X option followed by a list of the directories or files to be excluded.

For example, to exclude the /tmp and /var/log directories from the backup, you can use the following command:

dump -0 -u -f backup.dump / -X /tmp -X /var/log

This will create a level 0 dump (a full backup) of the / file system and save it to the backup.dump file, while excluding the /tmp and /var/log directories.

To exclude specific files, you can use the -x option followed by a list of the file names. For example, to exclude the /etc/passwd and /etc/shadow files from the backup, you can use the following command:

dump -0 -u -f backup.dump / -x /etc/passwd -x /etc/shadow

You can specify multiple directories or files to be excluded by separating them with a space.

Created Time:2017-10-30 14:27:22  Author:lautturi