This patch makes sure file time stamp and file permissions are preserved.
The patch is attached and is also at http://github.com/lflaks/cobbler/
This patch makes sure file time stamp and file permissions are preserved.
The patch is attached and is also at http://github.com/lflaks/cobbler/
Leonid,
You're using cp's -a flag here which does a lot more than just preserving the mode and timestamps. For example, -a changes the behavior of cp with regard to symlinks.
How would you feel about using -p instead which preserves the mode, ownership, and timestamps? ------------ Regards, Alex
Alex Wood wrote:
This patch makes sure file time stamp and file permissions are preserved.
The patch is attached and is also at http://github.com/lflaks/cobbler/
Leonid,
You're using cp's -a flag here which does a lot more than just preserving the mode and timestamps. For example, -a changes the behavior of cp with regard to symlinks.
How would you feel about using -p instead which preserves the mode, ownership, and timestamps?
Regards, Alex
I am not sure if -p would do the job. The point of that change was that original version was inconsistent. In order to save files we first copy them into /tmp and then after installation was done, copy them back into hard drive. If we used -a option in the first step, we should use it on the second step also, otherwise it makes no sense. We can use -p, but then it should be the same in both places. Those 3 snippets are saving very specific files each and there are no symlinks in there. However, I was thinking of making some more generic snippet, in which user just enters the data that he/she wants to save. It could be shell glob or list of globs. In this case we need to think what we want cp to do, as we have no idea what could be in that preserved data. Actually, looking at cp man page, I see that -p does not preserve context, also -R option (part of -a) would traverse directories recursively - useful for that generic snippet.
Looks like I made probably more confusing then clear ;-(
Leon
On Wed, Jan 6, 2010 at 1:32 PM, Leonid Flaks flaks@bnl.gov wrote:
Alex Wood wrote:
This patch makes sure file time stamp and file permissions are preserved.
The patch is attached and is also at http://github.com/lflaks/cobbler/
Leonid,
You're using cp's -a flag here which does a lot more than just preserving the mode and timestamps. For example, -a changes the behavior of cp with regard to symlinks.
How would you feel about using -p instead which preserves the mode, ownership, and timestamps?
Regards, Alex
I am not sure if -p would do the job. The point of that change was that original version was inconsistent. In order to save files we first copy them into /tmp and then after installation was done, copy them back into hard drive. If we used -a option in the first step, we should use it on the second step also, otherwise it makes no sense. We can use -p, but then it should be the same in both places. Those 3 snippets are saving very specific files each and there are no symlinks in there. However, I was thinking of making some more generic snippet, in which user just enters the data that he/she wants to save. It could be shell glob or list of globs. In this case we need to think what we want cp to do, as we have no idea what could be in that preserved data. Actually, looking at cp man page, I see that -p does not preserve context, also -R option (part of -a) would traverse directories recursively - useful for that generic snippet.
Looks like I made probably more confusing then clear ;-(
Leon
If you plan to use globs and (by design) multiple files the only way I see to properly do this is to use tar or something similar. Granted the current keep_ssh_host_keys snippet is far better than I'd ever imagined when originally submitting it but replacing it with a generic one is a noteworthy goal.
Leon
If you plan to use globs and (by design) multiple files the only way I see to properly do this is to use tar or something similar. Granted the current keep_ssh_host_keys snippet is far better than I'd ever imagined when originally submitting it but replacing it with a generic one is a noteworthy goal.
I personally have no real need for it. If there is something important and of some size on the system, I would just make a backup. If generic one is ever made I don't see it replacing original, but rather having them both available. The current one assigns all variables at the very beginning, which (in my opinion) makes it very easy to modify for different use.
We are diverting from the question that Alex brought up though, of course. I think using -a is better then -p after all due to file contest.
I am not sure if -p would do the job. The point of that change was that original version was inconsistent. In order to save files we first copy them into /tmp and then after installation was done, copy them back into hard drive. If we used -a option in the first step, we should use it on the second step also, otherwise it makes no sense. We can use -p, but then it should be the same in both places. Those 3 snippets are saving very specific files each and there are no symlinks in there. However, I was thinking of making some more generic snippet, in which user just enters the data that he/she wants to save. It could be shell glob or list of globs. In this case we need to think what we want cp to do, as we have no idea what could be in that preserved data. Actually, looking at cp man page, I see that -p does not preserve context, also -R option (part of -a) would traverse directories recursively - useful for that generic snippet.
Looks like I made probably more confusing then clear ;-(
I just took a brief look at the patch since it has been languishing on the list for a few weeks now. After looking more carefully at the context, I see what you mean about not being consistent with the -a option.
I will go ahead and apply the patch. Thanks for your contribution. ---------------- Regards, Alex
cobbler-devel@lists.fedorahosted.org