Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: rsync across disks

  1. #1
    Join Date
    Feb 2010
    Location
    nh,usa
    Posts
    154

    Default rsync across disks

    openSuse V12.3 64

    from a command line, how do you rsync from 1 disk to another?

    the name of the second disk is Eight

    rsync -v -r -u -p -W -x --delete --progress --stats --log-file=rsync.log /David/ /Eight/David/

    thank you
    Regards,

    RIH5342

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: rsync across disks

    Quote Originally Posted by rih5342 View Post
    openSuse V12.3 64

    from a command line, how do you rsync from 1 disk to another?

    the name of the second disk is Eight

    rsync -v -r -u -p -W -x --delete --progress --stats --log-file=rsync.log /David/ /Eight/David/

    thank you
    The basic format would be:

    Code:
    sudo rsync -av --delete /Directory1/ /Directory2/
    Use sudo to backup files owned by root. You can can combine single dash commands together. You may want to add the --exclude= command for root or other backups:

    Code:
    sudo rsync -av --delete / /director2. --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Feb 2010
    Location
    nh,usa
    Posts
    154

    Default Re: rsync across disks

    Great, I'll include sudo, but my problem is identifying the destination disk.

    Using gnome, applications, disks, I can see the first disk has 3 partitions, /dev/sda1 (swap), /dev/sda2 (bootable), /dev/sda3 (my files), and the second disk is /dev/sdb1 (more files).

    From a terminal command line, an ls command will display directories on /dev/sda3, and I assume rsync doesn't need the disk info if source and destination are both on that disk.

    Here is my question: Whats the syntax to include the disk info in the destination, is it something like.

    Code:
    sudo rsync -av --delete /Directory1/ /dev/sda3/Directory2/  
    
    or is it
    
    sudo rsync -av --delete /Directory1/ /dev/sda3:Directory2/
    Thank you.
    Regards,

    RIH5342

  4. #4
    Join Date
    Aug 2008
    Location
    Seattle, WA
    Posts
    1,376

    Default Re: rsync across disks

    Quote Originally Posted by rih5342 View Post
    Great, I'll include sudo, but my problem is identifying the destination disk.

    Using gnome, applications, disks, I can see the first disk has 3 partitions, /dev/sda1 (swap), /dev/sda2 (bootable), /dev/sda3 (my files), and the second disk is /dev/sdb1 (more files).

    From a terminal command line, an ls command will display directories on /dev/sda3, and I assume rsync doesn't need the disk info if source and destination are both on that disk.

    Here is my question: Whats the syntax to include the disk info in the destination, is it something like.

    Code:
    sudo rsync -av --delete /Directory1/ /dev/sda3/Directory2/  
    
    or is it
    
    sudo rsync -av --delete /Directory1/ /dev/sda3:Directory2/
    'df -l' will show you the mountpoint of the device. That will be your target directory.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,278
    Blog Entries
    15

    Default Re: rsync across disks

    On Wed 16 Oct 2013 10:46:02 PM CDT, rih5342 wrote:


    Great, I'll include sudo, but my problem is identifying the destination
    disk.

    Using gnome, applications, disks, I can see the first disk has 3
    partitions, /dev/sda1 (swap), /dev/sda2 (bootable), /dev/sda3 (my
    files), and the second disk is /dev/sdb1 (more files).

    From a terminal command line, an ls command will display directories on
    /dev/sda3, and I assume rsync doesn't need the disk info if source and
    destination are both on that disk.

    Here is my question: Whats the syntax to include the disk info in the
    destination, is it something like.


    Code:
    --------------------
    sudo rsync -av --delete /Directory1/ /dev/sda3/Directory2/

    or is it

    sudo rsync -av --delete /Directory1/ /dev/sda3irectory2/








    --------------------


    Thank you.


    Hi
    It's the mount point not the dev(ice) partition.

    If you own the directories as your user there is no need for sudo.

    I use the following to rsync various data directories to an external
    device;
    Code:
    /usr/bin/rsync -rlLtuzi --stats --progress --delete \
    /data/$X/* $TARGET_DEV/$HOST_DEV/$X/
    X is a list of directories I want backed up, TARGET_DEV is the mount
    point and HOST_DEV is a directory on the target device owned by me.

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE 12.3 (x86_64) GNOME 3.8.4 Kernel 3.7.10-1.16-desktop
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  6. #6
    Join Date
    Feb 2010
    Location
    nh,usa
    Posts
    154

    Default Re: rsync across disks

    I'm all set, thank you.
    Regards,

    RIH5342

  7. #7
    Join Date
    Feb 2010
    Location
    nh,usa
    Posts
    154

    Default Re: rsync across disks

    Guess I spoke too soon.

    How do I delete directories on the rsync'd disk?

    All file's and folders have X's and locks on the icons, I can't change permissions.

    When I login as root, the second disk doesn't appear.

    Thank you.
    Regards,

    RIH5342

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,278
    Blog Entries
    15

    Default Re: rsync across disks

    Quote Originally Posted by rih5342 View Post
    Guess I spoke too soon.

    How do I delete directories on the rsync'd disk?

    All file's and folders have X's and locks on the icons, I can't change permissions.

    When I login as root, the second disk doesn't appear.

    Thank you.
    Hi
    Can you post the output from the command (with the second disk attached);
    Code:
    lsblk
    Can you cd to the second disk and post the output from;
    Code:
    ls -la
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Feb 2010
    Location
    nh,usa
    Posts
    154

    Default Re: rsync across disks

    Here's my problem, I'm a new linux user and the disk mount paradigm makes no sense ( to a windows user).

    Here's what I did since my last post.

    1. login as root, go find the second disk (using gnome, applications, disk), delete the files and directories, logout.
    2. login as me, can't find the disk, logout, login as root, unmount the disk, logout.
    3. login as me, mount the disk, redo the rsync with better source and destinations, which now works as follows ( JOY !)

    Code:
    rsync -vlLrtp --delete --progress --stats --log-file=Eight_Copy_Log.txt  /home/david/___David/  /var/run/media/david/Eight_Copy/___David/
    You asked for....

    HTML Code:
    david@linux-kr5n:~> lsblk
    NAME                      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    sda                         8:0    0 465.8G  0 disk  
    ├─sda1                      8:1    0     2G  0 part  [SWAP]
    ├─sda2                      8:2    0    20G  0 part  /
    └─sda3                      8:3    0 443.8G  0 part  
      └─cr_ata-TOSHIBA_DT01ACA050_Y2HMH8YFS-part3 (dm-0)
                              253:0    0 443.8G  0 crypt /home
    sdb                         8:16   0 465.8G  0 disk  
    └─sdb1                      8:17   0 465.8G  0 part  
      └─luks-96faa79c-9797-400e-9d80-723d048dd598 (dm-1)
                              253:1    0 465.8G  0 crypt /run/media/david/Eight_Copy
    and

    HTML Code:
    david@linux-kr5n:~> ls -la 
    total 7572
    drwxr-xr-x 50 david users    4096 Oct 17 09:39 .
    drwxr-xr-x  4 root  root     4096 Aug 18 14:18 ..
    drwx------  4 david users    4096 Apr  6  2013 .adobe
    -rw-------  1 david users    5074 Oct 17 09:35 .bash_history
    -rw-r--r--  1 david users    1177 Jan 13  2013 .bashrc
    drwxr-xr-x  3 david users    4096 Sep 28 15:39 bin
    drwxr-xr-x 22 david users    4096 Sep  9 21:54 .cache
    drwxr-xr-x  7 david users    4096 Mar 14  2013 .cddb
    drwx------ 25 david users    4096 Oct 15 19:12 .config
    drwxr-xr-x 37 david users    4096 Oct 17 09:44 ___David
    drwx------  3 david users    4096 Jan 13  2013 .dbus
    .
    .
    .
    Again I think I'm all set, alot of work to make a copy of a directory from 1 disk to another.

    Thank you.
    Regards,

    RIH5342

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: rsync across disks

    On 2013-10-17 17:36, rih5342 wrote:
    >
    > Here's my problem, I'm a new linux user and the disk mount paradigm
    > makes no sense ( to a windows user).


    Well, Linux and Windows are different. In linux, there are no "disks",
    all are directories. You do not "rsync across disks", instead you "rsync
    across directories"; only that you know that the directories happen to
    belong to different disks.

    >
    > Here's what I did since my last post.


    ....

    > Again I think I'm all set, alot of work to make a copy of a directory
    > from 1 disk to another.


    It looks very simple to me :-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

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