Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
.keep files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Fri Jan 15, 2016 7:30 am    Post subject: .keep files Reply with quote

what are all these .keep files littered all over the filesystem? they all seem to be empty. if they are not needed, can i delete them?
Back to top
View user's profile Send private message
Perfect Gentleman
l33t
l33t


Joined: 18 May 2014
Posts: 860

PostPosted: Fri Jan 15, 2016 7:48 am    Post subject: Reply with quote

it's for portage purpose not to delete those folders, afaik
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 2:34 pm    Post subject: Reply with quote

so if i deleted that empty .keep file in a directory, portage might delete that directory?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44020
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 2:52 pm    Post subject: Reply with quote

josephg,

Its from the stage3 tarball. tar will not include empty directories, so empty .keep files are added so that the stage3 can provide your install with otherwise empty directories.

Think /home, /boot and others, that are provided empty that you add content to.

They are only needed in otherwise empty directories that you might want to backup with tar.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 4:10 pm    Post subject: Reply with quote

so i guess i can now remove all those empty .keep files all over the filesystem, and not worry that something will go missing somewhere. i think most of those directories are not empty now.

as i said i'm a bit ocd about having a clean system. and things lying around without me knowing what they are, keeps niggling me.


Last edited by josephg on Wed Jan 20, 2016 1:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44020
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 4:16 pm    Post subject: Reply with quote

josephg,

Its safe to remove them from populated directories.

Its safe to remove them from unpopulated directories with the proviso that the directory will not be saved in a stage4 tarball.
When you restore from such a stage4 tarball, if you ever need the missing directories, you will need to recreate them, along with correct owner, group and permissions.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 4:21 pm    Post subject: Reply with quote

btw tar will include empty directories

Code:
~ $ cd /tmp
/tmp $ mkdir empty1 empty2 empty3
/tmp $ $ ls -aR empty*
empty1:
. ..

empty2:
. ..

empty3:
. ..
/tmp $ tar cafv empty.tar.gz empty*                                                                                                                                         
empty1/
empty2/
empty3/
/tmp $ mkdir directory
/tmp $ cd directory/
/tmp/directory $ tar xafv ../empty.tar.gz
empty1/
empty2/
empty3/
/tmp/directory $ ls -aR
.:
.  ..  empty1  empty2  empty3

./empty1:
.  ..

./empty2:
.  ..

./empty3:
.  ..


Last edited by josephg on Mon Jan 18, 2016 6:38 pm; edited 3 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44020
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 4:30 pm    Post subject: Reply with quote

josephg,

Things are always changing.
Thank you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jan 17, 2016 5:04 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Its safe to remove them from unpopulated directories with the proviso that the directory will not be saved in a stage4 tarball.
When you restore from such a stage4 tarball, if you ever need the missing directories, you will need to recreate them, along with correct owner, group and permissions.


i don't remember seeing stage4 mentioned anywhere. is that how you take backups? i suppose i am not there yet.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44020
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 5:16 pm    Post subject: Reply with quote

josephg,

Stage1 and stage2 are obsolete unsupported Gentoo install start points.
Stage3 is the tarball you downloaded for your install.
Stage4 is a tarball of your install.

Google will find you instructions to make a stage4
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Jan 17, 2016 5:42 pm    Post subject: Reply with quote

josephg ...

it is actually to stop the package manager from removing these directories ...

equery -NC files net-analyzer/iptraf-ng | egrep '^\/var':
/var
/var/lib
/var/lib/iptraf-ng
/var/lib/iptraf-ng/.keep_net-analyzer_iptraf-ng-0
/var/log
/var/log/iptraf-ng
/var/log/iptraf-ng/.keep_net-analyzer_iptraf-ng-0

... that would place '/var/log/' and '/var/lib' in the list of installed files for net-analyzer/iptraf-ng, and so to prevent any package removing these on --depclean '/var/{lib,log}/.keep' exists to make sure that directory is never empty.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44020
Location: 56N 3W

PostPosted: Sun Jan 17, 2016 6:02 pm    Post subject: Reply with quote

khayyam,

Thank you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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