I need to emulate the copy command with preserves file & directory
attributes and hard-links files instead of copying.
This is normally done by "cp -al"
My problem is that I want to do that on a Terastation Pro II which uses a
busybox cp command which does not support the -l option.
So I am searching for a as simple as possible solution to emulate that which
should also be as fast as possible.
How would you do that?
Many thanks in advance,
yours Henri
> I need to emulate the copy command with preserves file & directory
> attributes and hard-links files instead of copying.
>
> This is normally done by "cp -al"
>
> My problem is that I want to do that on a Terastation Pro II which uses a
> busybox cp command which does not support the -l option.
find, if it's not a file then cp -a it, else ln it?
--
John Stumbles
I used to think the brain was the most interesting part of the body
- until I realised what was telling me that
> On Sat, 14 Feb 2009 16:20:28 +0100, Henri Schomäcker wrote:
>
>> I need to emulate the copy command with preserves file & directory
>> attributes and hard-links files instead of copying.
>>
>> This is normally done by "cp -al"
>>
>> My problem is that I want to do that on a Terastation Pro II which uses a
>> busybox cp command which does not support the -l option.
>
> find, if it's not a file then cp -a it, else ln it?
>
First of all, don't need it anymore because I now use the rsync --link-dest=
option which I wanted to avoid because I preferred rsyncing at night and
rotating the backups at day.
Im' still testing but abandoning the transfer by ssh and optimising for
network speed gave me some more transmission in the backup-time-frame.
I also thought of the solution you mentioned but am sure that that's a very
resources-intensive solution because in the case of a full-backup the whole
server-installation would need to be searched.
I also found a solution using cpio but unfortunately cpio is also not
installed on a Terastation Pro II by default.
Replacing the OS unfortunately is also no option because it's not my box and
the customer does not want that because it might break the guarantee.
Many thanks for your answer John,
yours Henri
> First of all, don't need it anymore because I now use the rsync
> --link-dest= option which I wanted to avoid because I preferred rsyncing
> at night and rotating the backups at day.
I was going to suggest rsync but thought if your cp didn't have -l what
would be the chances of having rsync?! :-)
--
John Stumbles
A backstreet vasectomy left me sterile
> On Mon, 16 Feb 2009 20:00:29 +0100, Henri Schomäcker wrote:
>
>> First of all, don't need it anymore because I now use the rsync
>> --link-dest= option which I wanted to avoid because I preferred rsyncing
>> at night and rotating the backups at day.
>
>
> I was going to suggest rsync but thought if your cp didn't have -l what
> would be the chances of having rsync?! :-)
>
Oh, this is very common for small network attached storage arrays.
The reason is they have rsync installed for the backup functions but don't
have coreutils installed but use busybox instead which emulates important
system commands.
The principle of busybox is that for example /bin/cp is a symlink to busybox
and when /bin/cp is called, busybox behaves like the cp command.
Pretty tricky, isn't it? :)
Yours,
Henri Schomäcker
> The principle of busybox is that for example /bin/cp is a symlink to
> busybox and when /bin/cp is called, busybox behaves like the cp command.
> Pretty tricky, isn't it? :)
Standard *n*x trickery, methinks :-)
What's a busybox anyway - some sort of NAS device? (Sorry, I know I should
STFW :-))
--
John Stumbles
Life is nature's way of keeping meat fresh
> What's a busybox anyway - some sort of NAS device? (Sorry, I know I should
> STFW :-))
http://www.busybox.net/downloads/README
What is busybox:
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the
utilities you usually find in bzip2, coreutils, file, findutils, gawk, grep,
inetutils, modutils, net-tools, procps, sed, shadow, sysklogd, sysvinit, tar,
util-linux, and vim. The utilities in BusyBox often have fewer options than
their full-featured cousins; however, the options that are included provide
the expected functionality and behave very much like their larger
counterparts.
Many thanks Maxwell for your very good explanations!
just want to add (may only be important for those who are interested in the
thread subject) that the actual version of busybox also supports the -l
option for the cp command.
Yours Henri