D
Deleted member 43773
Guest
Hi all readers,
I'am trying to set up a little copy script for backup selected files from my /home/me (FreeBSD 12.1 on a ZFS)
When I am trying to use cp with full path of the file(s) to be back upped in a script, I receive either "file not found" or "permission denied" (on reading (!?) - I am the owner of my /home/me, directories have x bits set, also as the permissions are set (drwxr-rr-x) - I also receive "permission denied" when i run the script as root...) - and the file(s) exists.
So I thought a shellscript executed might not have the same permissions as the user who owns and started it - but it runs under my name, so I suggest for at least really simple scripts that should not the problem. Or the data being processed by a script going "other ways" as when I use the shell command via terminal...(?)
If I try to use cpio, what I'd rather like to do, because of its capability of generating a clone of the path (subdirectories) of a file, I receive "Cannot extract through symlink".
Besides I don't see, why cpio -pdmu .... "extracts" anything in this case I understood, there seems to be some kind of link (what also might explain the permission issue, when in this case the access is done not directly, but via a link from somewhere else (?) where I don't have permissions - but I don't see it.
Yet I didn't find a link pointing at my /home/, and besides /usr/home/ I also don't know where to look for such.
There are two home-fs: /home/ and /usr/home/, where /usr/home/ seems to be empty and exists for "traditional"/compatibility(?)-purposes; at least I didn't found any link yet, that redirects from on home to the other.
What I think I understood so far:
- It's quite a difference how I pass the options to a command/filter within the script:
find .... | cpio ... produces a "Cannot extract through symlink"
but
find ... > textfile
read line < textfile
$line | cpio... produces a "permission denied", even it seems to be the same thing
(you see, I also still need to do some studying on scripting, too ;-)
But neither way works. Also it has nothing to do with (wrong) quoting, which may only produce the same results or an additional "file not found".
So I understand point is not my scripting, but my insufficient knowledge of the system.
- There is more than one way to access to a file, even if the path seems the same - depends on who (me/script) handles it.
What really bothers me is the "symlink" message.
Is it possible that my /home/. directory is not really the fs it seems to be, but a link, and where is it placed, where is the link, from where, how can I see it (no obvious links are shown to me so far) - how can i figure that out (/usr/home is empty) ?
#cd brings me in my /home/ #~ gives me a "permission denied"
I know that ~ this is no "change-directory" command, but simply a shortform of /home/me, rather $HOME - but is it normal to receive a "permission denied" instead of a "this is no command/I don't know what to do"? There seems to be a difference between /home/me and $HOME.
%zfs list shows me a mountpoint on /usr/home, but none on /home/ - and yet I didn't found any link from one to the other.
So it seems to me /usr/home is needless, and /home is "just a subdirectory" of / (root)
How can I figure out the exact location/mountpoint/path of my /home/?
I think to do %zfs create pool/home %zfs set mountpoint=/home pool/home BUT
- I'am not sure if this solves my problem
- And what happens then to my current /home/directories? Would that not cause to produce problems, because I'd have two /home fs - one via zfs and the other one from... "the system"(?), something like twice the same mountpoint, from two aspects, to two different locations?
On the other hand I think it may be possible to move my home-directories from /home to /usr/home - but all links pointing at /home would be broken then (if there are any), and I don't know, how to figure out, what points all at /home...and I don't know If this solves my problem, because I don't understand the cause of it.
...or shall I make a symlink from /usr/home to /home - but I also don't see how this would solve my permission problem....
Please, no side-topic discussions like "Why do you want to do backups like this, and don't...." - The purpose of my script is subsidiary;
I simply want to understand the ways of how a /home/me is part within the fs, and how this can lead to different access ways/permissions (if there are any), even if I own the directory and have the permissions.
Just experimenting wildely is not an option - my system is not a fresh installed "virgin" anymore... - and I don't want the things just get running, not really knowing why, I want to understand.
thanks in advance
Profighost
I'am trying to set up a little copy script for backup selected files from my /home/me (FreeBSD 12.1 on a ZFS)
When I am trying to use cp with full path of the file(s) to be back upped in a script, I receive either "file not found" or "permission denied" (on reading (!?) - I am the owner of my /home/me, directories have x bits set, also as the permissions are set (drwxr-rr-x) - I also receive "permission denied" when i run the script as root...) - and the file(s) exists.
So I thought a shellscript executed might not have the same permissions as the user who owns and started it - but it runs under my name, so I suggest for at least really simple scripts that should not the problem. Or the data being processed by a script going "other ways" as when I use the shell command via terminal...(?)
If I try to use cpio, what I'd rather like to do, because of its capability of generating a clone of the path (subdirectories) of a file, I receive "Cannot extract through symlink".
Besides I don't see, why cpio -pdmu .... "extracts" anything in this case I understood, there seems to be some kind of link (what also might explain the permission issue, when in this case the access is done not directly, but via a link from somewhere else (?) where I don't have permissions - but I don't see it.
Yet I didn't find a link pointing at my /home/, and besides /usr/home/ I also don't know where to look for such.
There are two home-fs: /home/ and /usr/home/, where /usr/home/ seems to be empty and exists for "traditional"/compatibility(?)-purposes; at least I didn't found any link yet, that redirects from on home to the other.
What I think I understood so far:
- It's quite a difference how I pass the options to a command/filter within the script:
find .... | cpio ... produces a "Cannot extract through symlink"
but
find ... > textfile
read line < textfile
$line | cpio... produces a "permission denied", even it seems to be the same thing
(you see, I also still need to do some studying on scripting, too ;-)
But neither way works. Also it has nothing to do with (wrong) quoting, which may only produce the same results or an additional "file not found".
So I understand point is not my scripting, but my insufficient knowledge of the system.
- There is more than one way to access to a file, even if the path seems the same - depends on who (me/script) handles it.
What really bothers me is the "symlink" message.
Is it possible that my /home/. directory is not really the fs it seems to be, but a link, and where is it placed, where is the link, from where, how can I see it (no obvious links are shown to me so far) - how can i figure that out (/usr/home is empty) ?
#cd brings me in my /home/ #~ gives me a "permission denied"
I know that ~ this is no "change-directory" command, but simply a shortform of /home/me, rather $HOME - but is it normal to receive a "permission denied" instead of a "this is no command/I don't know what to do"? There seems to be a difference between /home/me and $HOME.
%zfs list shows me a mountpoint on /usr/home, but none on /home/ - and yet I didn't found any link from one to the other.
So it seems to me /usr/home is needless, and /home is "just a subdirectory" of / (root)
How can I figure out the exact location/mountpoint/path of my /home/?
I think to do %zfs create pool/home %zfs set mountpoint=/home pool/home BUT
- I'am not sure if this solves my problem
- And what happens then to my current /home/directories? Would that not cause to produce problems, because I'd have two /home fs - one via zfs and the other one from... "the system"(?), something like twice the same mountpoint, from two aspects, to two different locations?
On the other hand I think it may be possible to move my home-directories from /home to /usr/home - but all links pointing at /home would be broken then (if there are any), and I don't know, how to figure out, what points all at /home...and I don't know If this solves my problem, because I don't understand the cause of it.
...or shall I make a symlink from /usr/home to /home - but I also don't see how this would solve my permission problem....
Please, no side-topic discussions like "Why do you want to do backups like this, and don't...." - The purpose of my script is subsidiary;
I simply want to understand the ways of how a /home/me is part within the fs, and how this can lead to different access ways/permissions (if there are any), even if I own the directory and have the permissions.
Just experimenting wildely is not an option - my system is not a fresh installed "virgin" anymore... - and I don't want the things just get running, not really knowing why, I want to understand.
thanks in advance
Profighost