Re: Backup problem using "cp"
- Date: Mon, 7 May 2018 06:31:16 -0500
- From: Richard Owlett <rowlett@xxxxxxxxxxx>
- Subject: Re: Backup problem using "cp"
On 05/06/2018 10:11 AM, Thomas Schmitt 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
richard@debian-jan13:~$ stat / | fgrep Device
Device: 80eh/2062d Inode: 2 Links: 22
richard@debian-jan13:~$ stat /media | fgrep Device
Device: 80eh/2062d Inode: 131073 Links: 5
I gather that "cp" is then an inappropriate tool.
"tar" is inappropriate for my preferences - I was attempting to use "cp"
as there would be multiple files &/or directories as input *and* output.
I suspect long term I want "rsync" [ *MUCH* reading to do! ]
Any way to accomplish that without explicitly listing all directories except
If it is indeed a bug with cp -x, then you could use some archiver like
"tar" which has options to exclude a file.
> Get inspiration from googling "tar pipe for copying".
Although I wish to avoid "tar", I did get inspiration for a brute force
method - I'll try it first before commenting.