[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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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 11: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.