View previous topic :: View next topic |
Author |
Message |
Elleni Veteran
Joined: 23 May 2006 Posts: 1289
|
Posted: Tue Jan 03, 2023 7:11 pm Post subject: [solved] exclude userhome from mkstage4 |
|
|
Is it possible to use mkstage4 but excluding a whole folder example userhome /home/ including subfolders? In help I read to not include /path/to/folder/* with -e option.
Last edited by Elleni on Wed Jan 04, 2023 3:35 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22796
|
Posted: Tue Jan 03, 2023 8:00 pm Post subject: |
|
|
I am not familiar with this script, but from a basic review of its code, yes, passing -e will add a --exclude= to the invoked tar. Per tar rules, you can exclude a directory and everything below it, with a glob like the one you showed. |
|
Back to top |
|
|
Elleni Veteran
Joined: 23 May 2006 Posts: 1289
|
Posted: Tue Jan 03, 2023 10:36 pm Post subject: |
|
|
Unfortunatelly it doesn't work, as stated in the help file:
Code: | -e: an additional excludes directory (one dir one -e, donot use it with *). |
And if you try it anyway: Code: | mkstage4 -e /home/myuser/* -s -C bz2 /home/myuser/backup/stage4-gentoo1-2023-01-02
mkstage4: no target specified.
usage:
mkstage4 [-q -c -b -l -k -p] [-s || -t <target-mountpoint>] [-e <additional excludes dir*>] [-i <additional include target>] <archive-filename> [custom-tar-options]
-q: activates quiet mode (no confirmation).
-c: excludes some confidential files (currently only .bash_history and connman network lists).
-b: excludes boot directory.
-l: excludes lost+found directory.
-e: an additional excludes directory (one dir one -e, donot use it with *).
-i: an additional target to include. This has higher precedence than -e, -t, and -s.
-s: makes tarball of current system.
-k: separately save current kernel modules and src (creates smaller archives and saves decompression time).
-t: makes tarball of system located at the <target-mountpoint>.
-C: specify tar compression (available: lz4 xz bz2 zst gz).
-h: displays help message.
|
|
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22796
|
Posted: Tue Jan 03, 2023 10:39 pm Post subject: |
|
|
You did not quote it, so your shell likely expanded it and confused the target script. |
|
Back to top |
|
|
Elleni Veteran
Joined: 23 May 2006 Posts: 1289
|
Posted: Wed Jan 04, 2023 3:35 pm Post subject: |
|
|
Thanks Hu, that did the trick |
|
Back to top |
|
|
|