Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] exclude userhome from mkstage4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1289

PostPosted: Tue Jan 03, 2023 7:11 pm    Post subject: [solved] exclude userhome from mkstage4 Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22796

PostPosted: Tue Jan 03, 2023 8:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1289

PostPosted: Tue Jan 03, 2023 10:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22796

PostPosted: Tue Jan 03, 2023 10:39 pm    Post subject: Reply with quote

You did not quote it, so your shell likely expanded it and confused the target script.
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1289

PostPosted: Wed Jan 04, 2023 3:35 pm    Post subject: Reply with quote

Thanks Hu, that did the trick :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum