문제

I used scp to copy file between servers without using 'preserve times' option and now want to restore original times of copy using source file times. Of course I can display these times, write it down and modify destination file. But I'm wondering if there is a posibility of using touch -r with reference file on remote server. Or if there is any other command/combination of commands which can grant me such goal.

도움이 되었습니까?

해결책

You could touch an intermediate file and use it to carry the information:

ssh user@hostname "touch file -r remote-file"

Then scp -p the new file back:

scp -p user@hostname:file local_destination

Then touch -r the file you copied in the first place.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top