Poster | Thread |
OldFart
| |
Problem with copying (soft-)links proper (SOLVED)(And then I could weep...) Posted on 18-Aug-2022 13:20:24
| | [ #1 ] |
|
|
|
Elite Member |
Joined: 12-Sep-2004 Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat! | | |
|
| Hi,
I'm in the process of copying quite a large amount of files from one volume to another, using C:Copy in one of these formats: C:Copy FROM -Source location- TO -Destination- ALL CLONE FOLLOWLINKS, but this does not copy any links proper.
C:Copy FROM -Source location- TO -Destination- ALL CLONE COPYLINKS FOLLOWLINKS, but this does copy the full, linked-to files into -Destination- and, again, NOT the links proper.
What is the proper format to achieve what I had in mind? (X5000 OS4.1 FE update 2)
OldFart Last edited by OldFart on 24-Aug-2022 at 08:39 AM. Last edited by OldFart on 22-Aug-2022 at 04:18 PM. Last edited by OldFart on 18-Aug-2022 at 01:21 PM.
_________________ More then three levels of indigestion and you're scroomed! |
|
Status: Offline |
|
|
thomas
| |
Re: Problem with copying (soft-)links proper Posted on 18-Aug-2022 16:54:38
| | [ #2 ] |
|
|
|
Super Member |
Joined: 28-May-2003 Posts: 1143
From: Germany | | |
|
| @OldFart
I am not familiar with the OS4 copy command, but in general to follow a link means to ignore that the link is a link and act on the linked-to object.
So my first action would be to remove the FOLLOWLINKS argument from the command line.
COPYLINKS sounds much more like what you want.
FOLLOWLINKS and COPYLINKS probably are mutually exclusive because, just judging from the names, they contradict each other.
_________________ Email: thomas-rapp@web.de Home: thomas-rapp.homepage.t-online.de |
|
Status: Offline |
|
|
OldFart
| |
Re: Problem with copying (soft-)links proper Posted on 18-Aug-2022 19:10:18
| | [ #3 ] |
|
|
|
Elite Member |
Joined: 12-Sep-2004 Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat! | | |
|
| @thomas
Thanks for your answer. From the documentation I get this: COPYLINKS Copy the contents of a file referenced by a hard or soft link; the default is to skip copying linked files. FOLLOWLINKS When used with the ALL option, the COPY command will follow hard and soft links to directories; the default is to skip links to directories.
The full documentation about Copy can be found HERE.
Edit: What's more: using WB's copy facility copies the links properly, but has other issues, like not copying icons with no file to belong to.
OldFart Last edited by OldFart on 18-Aug-2022 at 07:14 PM.
_________________ More then three levels of indigestion and you're scroomed! |
|
Status: Offline |
|
|
jPV
| |
Re: Problem with copying (soft-)links proper Posted on 18-Aug-2022 20:39:36
| | [ #4 ] |
|
|
|
Cult Member |
Joined: 11-Apr-2005 Posts: 812
From: .fi | | |
|
| @OldFart
Maybe you'll have to use some 3rd party program that handles the links correctly. Like BackUp, for example. _________________ - The wiki based MorphOS Library - Your starting point for MorphOS - Software made by jPV^RNO |
|
Status: Offline |
|
|
colinw
| |
Re: Problem with copying (soft-)links proper Posted on 19-Aug-2022 1:15:06
| | [ #5 ] |
|
|
|
Member |
Joined: 20-Jul-2007 Posts: 44
From: Brisbane, in the land of Oz | | |
|
| @OldFart
You are not going to get the "links propper" duplicated on the destination. If that's what you are hoping for.
Two reasons why the COPY command doesn't do what you want. COPYLINKS resolves the link target file and copies those to the destination. FOLLOWLINKS just allows it to go into linked directories to find more files. The default is to do neither.
What you appear to want is a DUPLICATELINKS option.
You can't have it because it could only work on softlinks for a start, because hardlinked targets must exist and be on the same volume as the link and the path to the target object may not exist yet, so that would take special handling as you may not be recreating the targets path from the copy operation.
And last of all, not all filesystems support hardlinks, SFS for example doesn't, so that means duplicating hardlinks won't work if the target filesystem was formatted as a SFS volume.
Of course you could add a "CONVERTHARDLINKSASSOFTLINKS" option too, to turn hardlinks into softlinks, but this is getting nasty and evil now and not what the COPY command should be used for.
Last edited by colinw on 19-Aug-2022 at 01:18 AM.
|
|
Status: Offline |
|
|
AlexC
| |
Re: Problem with copying (soft-)links proper Posted on 22-Aug-2022 9:05:51
| | [ #6 ] |
|
|
|
Super Member |
Joined: 22-Jan-2004 Posts: 1300
From: City of Lost Angels, California. | | |
|
| @OldFart
The best option to preserve links is to copy the volume at the block level to an identical partition (same filesystem. block size and number of blocks), which is great for making a backup but not very helpful in all other cases.
The next option would be to use SortCopy which can copy soft/hard links, although it may have issues with softlinks in some cases.
As Colin mentioned, it also depends on the destination filesystem being able to handle links.
Another option is to create a script to find all the links and generate another script to recreate them after copying all the files without the links.
If the Workbench copy really preserve the links, another option would be to copy everything using the Workbench and then use the Copy command to copy only the icons which don't exists on the destination, IIRC with: Copy CLONE ALL NEWER #?.info TO Destination:
_________________ AlexC's free OS4 software collection
AmigaOne XE/X1000/X5000/UAE-PPC OS4 laptop/X-10 Home Automation |
|
Status: Offline |
|
|
OldFart
| |
Re: Problem with copying (soft-)links proper Posted on 22-Aug-2022 16:40:27
| | [ #7 ] |
|
|
|
Elite Member |
Joined: 12-Sep-2004 Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat! | | |
|
| @AlexC and all other contributants:
Thanks for your idea's and explanations.
Well, in the meantime the problem has been solved, mostly by circumvention, to a large degree. The copyfunction Workbench provides is capable of copying links, at least the softlink variety. Hardlinks are rare as they are only supported by FFS iirc.
Problem I ran into was when said copyfunction encountered a file with a problematic character in its name. I discovered that characters like the 'French ç' (in old filesnames) gave rise to prematurely end the process of copying. I then tried to locate the offending entry, replaced the problematic characters and started the copying process all over again thereby skipping exsisting files.
It took a while and quite some retries, but in the end I got everything copied, including softlinks. The partition in question is my development partition and I make heavy use of links in a project: some 10 - 14 links are quite common. The number of projects is about 50 and not all links link to the same file, allthough over the projects visible under the same name. A script to reestablish/recreate those links is therefore quite tricky, on the verge of being impractical.
Thanks everyone!
OldFart
_________________ More then three levels of indigestion and you're scroomed! |
|
Status: Offline |
|
|
MichaelMerkel
| |
Re: Problem with copying (soft-)links proper (SOLVED) Posted on 23-Aug-2022 19:16:34
| | [ #8 ] |
|
|
|
Cult Member |
Joined: 9-Mar-2003 Posts: 819
From: Ilvesheim, Germany | | |
|
| @OldFart
as others already suggested i'd go to Backup, that works verey well and fast. i always us this to duplicate complete partitions or onle parts of it to another drive. you get identically copies including all links. i have not yout found anything better! really!
another possibility is mySync from Michael Christoph. that one was built during a workshop in amiga future magazine. it does more or less the same that also backup does. unfortunately it is slower during the sync process. but the result is good.
backup can be used from shell - mysync can't.
regards... michael _________________ Michael Merkel (Michael.Merkel@gmx.net Home) Member of Amiga-Freunde Pfalz, OS4 Welt |
|
Status: Offline |
|
|
OldFart
| |
Re: Problem with copying (soft-)links proper (SOLVED)(And then I could weep...) Posted on 24-Aug-2022 9:04:19
| | [ #9 ] |
|
|
|
Elite Member |
Joined: 12-Sep-2004 Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat! | | |
|
| @OldFart
This morning, August 24, 2022, I fired up my X5k as per usual. Nothing strange here and I opened up my "Development"-partition, noting something that made my eyebrows raise (and my heart sink): an entry "Releases" was followed by "Releases.info". Strange, very strange...
The worst had yet to come. Opening up a subdrawer in "Development:", called "Software Development" left me staring at...
...a completely empty window...
All my projects, documentation and whatnaught: gone! All of it gone! Right after having made again some strides in the past days.
In the first half of this year I had a simmilar experience and had lost quite a lot of my developments, but during the summer I was in the position to slowly piece together and reconstruct the damaged drawers and their contents, setting me back about a year in terms of development.
During the past few weeks and yesterday in particular, I was well on track again and had several projects working again, so I felt relieved, switched the machine off and had a beer.
With renewed vigour and enthousiasm I fired the machine up again this morning and now I'm looking for Kleenex...
OldFart _________________ More then three levels of indigestion and you're scroomed! |
|
Status: Offline |
|
|
MichaelMerkel
| |
Re: Problem with copying (soft-)links proper (SOLVED)(And then I could weep...) Posted on 24-Aug-2022 20:03:28
| | [ #10 ] |
|
|
|
Cult Member |
Joined: 9-Mar-2003 Posts: 819
From: Ilvesheim, Germany | | |
|
| |
Status: Offline |
|
|
OldFart
| |
Re: Problem with copying (soft-)links proper (SOLVED)(And then I could weep...) Posted on 25-Aug-2022 11:03:45
| | [ #11 ] |
|
|
|
Elite Member |
Joined: 12-Sep-2004 Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat! | | |
|
| @MichaelMerkel
Quote:
but you do have a backup? don't you? |
Yes of course I have, but the problem is that it dates from some time before I had applied some major updates, changes and improvements to the various (source-) files, so not really much of a help.
OldFart_________________ More then three levels of indigestion and you're scroomed! |
|
Status: Offline |
|
|
Hypex
| |
Re: Problem with copying (soft-)links proper (SOLVED)(And then I could weep...) Posted on 25-Aug-2022 13:00:09
| | [ #12 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11204
From: Greensborough, Australia | | |
|
| @OldFart
That is strange. Somehow it looks like an .info file was created as a regular file and not as an icon. Didn't know WB would even list an .info file even if invalid.
So is it blank when looking at all files from shell or DOpus?
If you can you may want to find some space on other partitions and see if PartitionWizard can salvage it across if it's gone that bad. |
|
Status: Offline |
|
|