Results 1 to 4 of 4

Thread: Rsync or cp command

  1. #1
    Join Date
    Jan 2008
    Beans
    34

    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
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    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
    http://ubuntuforums.org/showthread.p...ghlight=backup
    Sample rsync file, use a text editor and paste into a file & name it mybackup.sh

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

    #!/bin/bash
    # 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 mybackup.sh

    run it
    ./mybackup.sh

    https://help.ubuntu.com/community/rsync
    https://help.ubuntu.com/community/CronHowto
    Some files to exclude from /home:
    http://ubuntuforums.org/showthread.php?t=1883834
    More detail on /etc files to backup - post #3:
    http://ubuntuforums.org/showthread.php?t=1500559

    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 :
    http://ubuntuforums.org/showthread.php?t=2147295
    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
    Location
    Ghaziabad, India
    Beans
    133

    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
    Beans
    34

    Re: Rsync or cp command

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

Bookmarks

Posting Permissions

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