[SOLVED] cp the reply option is deprecated try using i or f instead
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i get "the reply option is deprecated try using i or f instead"
the problem with the above is the only thing i get in my error log is: "the reply option is deprecated try using i or f instead"
and if i use "i , f , /cp , etc..." nothing is generated in my log...
what i want to do is copy file from source with "LRuvp" to destination and appened out put to "error.log"
Not sure I 100% understand what the deal is with the --reply option, as I've never used it. However, by directing 2> to the log, you're only catching errors; you're neglecting to catch "non-errors".
the reply option is because i am using -u so it asks me if i want to overwrite a existing file, i need --reply=yes as this issue is part of a shell backup script loaded into cron to run @ 8pm every night. i cant hit enter every time it prompts me to overwrite the file...
with this first cp command i want to create the error log >/mnt/usbdrive/error.log and with the next commands in script i append there output to the same file>>/mnt/usbdrive/error.log
when i try cp -LRuvp --reply=yes /mnt/filename /mnt/usbdrive/filename >> /mnt/usbdrive/error.log 2>&1 OR cp -LRuvp --reply=yes /mnt/filename /mnt/usbdrive/filename > /mnt/usbdrive/error.log 2>&1
I still get the reply option is deprecated as the only output in my logfile
Hmm.. OK, have you tried my example, with the redirects as I showed, AND used the -i option instead of the --reply=yes option as it implies you should?
Seems logical that that should work. I've made lots of similar scripts and have had no trouble getting the output to go to the log file.
Is the cp command aborting when it finds the --reply option? Or maybe, is there actually stuff to copy? If there's not (because maybe everything's already up-to-date) then that's why no output is being generated: there's nothing to copy.
if i try how you suggest, in my error log i get the "cp: overwrite /mnt/file/***** ?'
this is why i need to have reply=yes in my command, however having the reply=yes, i only get "the reply option is deprecated" which brings me back to my dilema.....
OK, my apology if I'm missing something and making this harder than it should be
So.. I assume you are using the --reply=yes option so you don't have to press ENTER all the time. If that's the case, use the -f option instead. You won't be asked about every file, and the -u option will copy only files that have changed.
Options I would use typically for such an application, are -Rfuvp (and you add the -L option as you wish).
lol no problem just trying to solve this issue has been racking my brain for a while.....
i have tried "i" and "f" as you suggest but with both options it still prompts to overwrite in my error log....
thats is correct, doing it exactly as u say above without "i" or "reply=yes" it prompts me for the overwrite in my error log and wont move forward...
please let me know when you find out something, much appreciated....
david
thats is correct, doing it exactly as u say above without "i" or "reply=yes" it prompts me for the overwrite in my error log and wont move forward...
please let me know when you find out something, much appreciated....
david
OK, and just for absolute clarity, you ARE using the -f option, yes?
it says "cp: overwrite /mnt/usbdrive/filename.file ?"
however when i hit ctrl-z to stop the command i see "cp -i -LRuvpf" and i never put in the "i"
i cant get it to not insert the "i" im not sure why its being automatically inserted, and the reason i can tell its there is when i hit ctrl-z it shows "cp -i -LRuvpf" instead of "cp -LRuvpf" -how i typed it
That's cool! Nice. But I *still* don't understand WHY it's asking you anything at all ..... Odd. I hope someone sheds light on this!
Sasha
Maybe cp is aliased to 'cp -i' (I remember in old unix machines this was a default or just an habit of system administrators - I don't know exactly). Davide, the command
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.