Re: Backup problem using "cp"
On 5/6/18, Thomas Schmitt <email@example.com> wrote:
> Richard Owlett wrote:
>> Thought I was doing that by specifying -x.
> Either cp -x has a bug or the target directory is not in a different
> filesystem than "/" and not a mount point of such a filesystem.
> Check the device numbers of "/" and "/media/richard/MISC...".
> E.g. like this
> $ stat / | fgrep Device
> Device: 803h/2051d Inode: 2 Links: 25
> $ stat /bkp | fgrep Device
> Device: 814h/2068d Inode: 2 Links: 7
> Here "/bkp" has a different device number (2068) than "/" (2051).
> So it (its inode, to be exacting) is in a different filesystem.
> As contrast see a directory in the same filesystem as "/":
> $ stat /home | fgrep Device
> Device: 803h/2051d Inode: 2228225 Links: 60
>> Any way to accomplish that without explicitly listing all directories
>> /media ?
> If it is indeed a bug with cp -x, then you could use some archiver like
> "tar" which has options to exclude a file.
> Totally untested fantasy:
> $ tar cf - --exclude=/media / | (cd /media/.../dev_sda14 ; tar xf - )
> Get inspiration from googling "tar pipe for copying".
I use "--exclude" with rsync so I tried a quick search with that, too.
It's a handy keyword to throw into the search mix.
"tar" and "file" have been coming up for me for specific copy needs
lately, primarily related to plucking via time stamps within large,
single directories. :)
Talking Rock, Pickens County, Georgia, USA
* runs with duct tape *