Results 1 to 4 of 4

Thread: Rsync or cp command

  1. #1
    Join Date
    Jan 2008

    Rsync or cp command

    I have just installed Ubuntu Server 10.04LTS and have two 2TB hard drives that I'm using to share my video and music files.
    I'm trying to make a mirror copy of directory "/server/" to directory "/backup/" along with all of their sub-directories. I've been looking over
    different web pages that I've found, and the two main options that I've come up with are the 'cp' command and the 'rsync' command.

    Using the cp command:
    cp -iaruv /server/ /backup/

    Or using the rsync command:
    rsync -aruWv /storage/ /backup/

    Do these parameters look correct, and if so, Which of these two would be more what I'm looking for?

  2. #2
    Join Date
    Jun 2009
    SW Forida
    Ubuntu 16.04 Xenial Xerus

    Re: Rsync or cp command

    I prefer rsync, but I am not sure of all the differences.

    Originally Posted by MountainX View Post #20 also other backup apps
    Sample rsync file, use a text editor and paste into a file & name it

    -l: copies symlinks as symlinks
    -t: preserves modification times
    -D: preserves device and special files

    # backup script
    # a - archive, retain file settings equals -rlptgoD (no -H,-A,-X)
    # r - recursive / subdirectories
    # u - update, only newer
    # v - verbose
    # P - keep partial files and report progress
    echo "starting..."
    rsync -aruvlP /mnt/data/Documents /mnt/backup

    echo "done"
    exit 0

    make it executable
    chmod +x

    run it
    Some files to exclude from /home:
    More detail on /etc files to backup - post #3:

    I do not backup system, but for a server that my be different. I assume I will just do a new install and restore from the data I do backup.
    For more info on UEFI boot install & repair - Regularly Updated :
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    kjohri is offline Gee! These Aren't Roasted!
    Join Date
    Dec 2008
    Ghaziabad, India

    Re: Rsync or cp command

    rsync is the preferred command. The following command should be sufficient,

    sudo rsync -avz /server/ /backup/

  4. #4
    Join Date
    Jan 2008

    Re: Rsync or cp command

    All right. Rsync looks like it's what I'll need. Thank you both for the help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts