I have a question that I cannot find the answer to.
I am trying to write a shell script to perform a full system backup using tar. Obviously, there are several folders that I do not want to do for backup (/ dev, / mnt, / proc, / tmp, etc.). There are a large number of folders that I do not want to backup, so I use the "exclude-from" flag so that the command is relatively clean.
The problem is that it does not work.
Here are the tar flags that I use:
--create
--file $BACKUP_FILE
--preserve-permissions
--same-owner
--numeric-owner
--listed-incremental $INCREMENTAL_FILE
--level=0
--xz
--directory /
--exclude-caches
--exclude-from $EXCLUDE_FILE
-v
Here is my exception file:
/dev
/lost+found
/media
/mnt
/proc
/run
/sys
/tmp
/var/spool
/var/run
/var/tmp
script, - , . "-exclude" ( ). "-exclude-from $EXCLUDE_FILE" "-exclude-from = $EXCLUDE-FILE", , ( , ).
tar, , -, , . , , .
Googling , , , , , "/" . , , , . , , "media" , , /media, .