loh-tar / cpd

A pure bash script to collect copy jobs and start them only if the target drive is not busy by any other job under supervision of cpd
GNU General Public License v2.0
2 stars 1 forks source link

Support non-GNU cp? rsync? #5

Open Ambrevar opened 6 years ago

Ambrevar commented 6 years ago

I believe cpd relies a lot on GNU cp at the moment. Is it necessary? Would this work with *BSD cp and on macos?

I think it would be very useful if cpd would be as generic as possible so that users can define their own copy tool. For instance, what about using rsync instead of cp?

It might not be doable, but let's think through this for a while, since it might be crucial to tackle this as early as possible.

loh-tar commented 6 years ago

I believe cpd relies a lot on GNU cp at the moment.

Does it? I don't know! I know nothing about BSD/macos and my cp man page has no POSIX notes.

When I search for some solution and found a hint about portability I always try to use the one which is not too GNU/Linux specific.

.. what about using rsync instead of cp?

While I have code the resent change to a separate file with the list of sources, I hassle pretty much to use this list. One thought was to use rsync for that.

I don't know. Currently it seamed to work so far, but may not perfect implemented.

I think it would be very useful if cpd would be as generic as possible

Generic in a way free to choose the copy tool make no sense to me.

Generic in a way to choose any tool to do some job and track the limited device sounds nice, but I fear that need some *NIX guru, not me :-)

Ambrevar commented 6 years ago

You can read the FreeBSD man page online for instance:

https://www.freebsd.org/cgi/man.cgi?query=cp&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html

Generic in a way to choose any tool to do some job and track the limited device sounds nice

What does "do some job" and "track the limited device" mean?

loh-tar commented 6 years ago

After last posting above, I thought for a while and then popped --parent in my mind. Options like --foo are GNU stuff. Any other things you have in mind? The link is nice but digging around could be annoying. Quick search for "parent" there give no hit, hm...

cpd is for copy files only. So the "job" is "copy" and the "limited device" is the target drive. I may better wrote "limited resource".

What ever "some job" could be, I don't know.

loh-tar commented 6 years ago

Aha, interesting read, these man page.

There is no -t, not so nice, but they have SIGINFO which would have prevent me to go the path to collect all files just to have my loved progress info.