[SOLVED] cp - how to copy data to an existed folder without asking overwrite?
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.
check what is the output of the command alias. I think there might be an alias for cp like alias cp='cp -i', which is why cp -rf asking for confirmation.
alias cp='cp -i'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
I am trying rsync. To me, rsync is a big tool to be used in my case.
1) rsync efficiency is not better than cp command for new added stuff;
2) If logbackup folder has very big data like 40GB, the increament list created by rsync takes too much time.
I just need to copy new created logs to the backup folder.
I am trying rsync. To me, rsync is a big tool to be used in my case.
1) rsync efficiency is not better than cp command for new added stuff;
2) If logbackup folder has very big data like 40GB, the increament list created by rsync takes too much time.
I just need to copy new created logs to the backup folder.
Pls correct me if I am wrong on rsync.
Thanks a lot.
rsync is much better for backing up than cp, by far. Yes the increment list takes a long time on a big archive, but the advantage is rsync will ONLY copy over those files which have changed, whereas cp will overwrite everything, every time. If your disc has an 80MB/s write speed and you're backing up a 40GB archive, cp will take a minimum of 8-9 minutes. If it's a lot of small files, it could easily take upwards of 30 minutes or more. On the same operation, rsync may take 2-3 minutes to build up the increment list, but then it might only take 20 seconds to copy the changed files over, depending on how many have changed since the last backup. It's especially useful when backing up across a network connection, or the internet.
Last edited by suicidaleggroll; 01-19-2012 at 10:17 AM.
the advantage is rsync will ONLY copy over those files which have changed
It is even better than that. rsync detects the changes and copies only what actually has changed. If you have for example a large log-file and only a few lines have changed rsync will not copy the whole file, but only the changes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.