Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: RSYNC. Anyone want to write 3 commands with the paths?

  1. #1
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    RSYNC. Anyone want to write 3 commands with the paths?

    Would anyone care to write the commands for 3, 4 and 7, so I can see how to do this, properly?

    This is a test. Yes, I want the *data_file to be in two partitions on my usb drive. In reality, I will use UUID's instead /dev/sda1 etc.

    I don't care much which options I use for testing, but I will suggest as Psychocats.net/ubuntu/backup, we use: < rsync -av >

    RSYNC TEST


    1. I will place a data_file on /dev/sda1/~/Desktop/ (My /home/Desktop/ on Xubuntu 12.04).
    2. Identify where that file is. (check if it is at /dev/sda1/~/Desktop/data_file).
    3. Write Rsync command to copy the data_file to /media/dev/sdf5/ (partition on usb drive) for backups). Then, run it.
    4. Write Rsync command to copy the (data_file) in /media/dev/sdf5/data_file to /media/dev/sdf6/ (another partition on usd drive). Then, run it.
    5. See if I can use Thunar to open data_file in /media/sdf6/data_file. If good, go to 6.
    6. Delete in /dev/sda1/~/Desktop/data_file. (Delete the data_file)
    7. Write Rsync command to Restore data_file from /dev/sdf6/data_file to sda1/~/Desktop/. Then, run it.
    8. Check if I have the data_file again on my desktop. (/dev/sda1/~/Desktop/data_file). If yes, then ...
    9. Celebrate!


    Thank you.
    Last edited by mikodo; December 29th, 2013 at 12:20 AM.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    These are parts of my rsync file which you can modify. I started with this:
    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
    I do not have any error checking other than the exit 0 if it finishes.

    I only need this the first time I run it in a new install, but I have it in my file
    # ! not
    if [ ! -d /mnt/backup ]; then
    mkdir /mnt/backup
    fi

    mount -t ext3 /dev/sda2 /mnt/backup

    echo "starting..."
    rsync -aruvlP /mnt/data/Documents /mnt/backup
    rsync -aruvlP /mnt/data/Projects /mnt/backup
    rsync -aruvlP /mnt/data/Notebooks /mnt/backup
    rsync -aurvlP --exclude-from=mybackup_excludes.lst /home /mnt/backup
    echo "done"
    exit 0

    I have another file that has a list of excludes so temporary files are not copied.

    https://help.ubuntu.com/community/rsync

    Backup to external with check of mounted & email
    http://ubuntuforums.org/showthread.php?t=1701292
    rsync confirmation list:
    http://ubuntuforums.org/showthread.php?t=1692800
    Check for mount of backup partition
    http://ubuntuforums.org/showthread.php?t=1701292
    #http://ubuntuforums.org/showthread.php?t=1555647&page=4
    more scripts:
    http://ubuntuforums.org/showthread.php?t=1319155

    Some more examples:
    http://rsync.samba.org/examples.html
    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
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Thanks Fred,

    I am only trying to learn to run the rsync commands, not a bash script with them.

    I did garner some help from the Ubuntu Community link on Rsync.

    Interesting that you responded, as this is part of my plan to place *folders on a Data partition, (back them up too, eventually on another drive, yet) and then be able to symlink them back to the multi-boot distros' root folders, following your guides to do that.

    *folders like:

    Music
    Documents
    Pictures
    Videos
    PDF_Books

    and the like ....

    Thanks.
    Last edited by mikodo; December 27th, 2013 at 07:15 AM.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    I did that once way back when I converted to a Linux data partition. I already had NTFS shared data partition but only linked it into /home as one link.

    But the rsync is the same command. You can also use cp with -a to preserve ownership & permissions.
    The issue I always have with cp or rsync is whether I am including the / at the end and then whether I copy just the levels below or not. Sometimes duplicated entire copy. Somewhere was a thread explaining that but I still mess it up.

    I have a script to mount my laptop folders, and another script to copy some folders from laptop (LT). File structure is identical on both systems. Same script but with DT folders mounted in laptop to copy from desktop.

    But these copy specific folders.
    rsync -aruvP /mnt/data_LT/Documents /mnt/data
    rsync -aruvP /mnt/data_LT/Projects //mnt/data
    rsync -aruvP /mnt/data_LT/PDF /mnt/data
    Last edited by oldfred; December 27th, 2013 at 04:18 PM.
    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.

  5. #5
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Quote Originally Posted by oldfred View Post
    The issue I always have with cp or rsync is whether I am including the / at the end and then whether I copy just the levels below or not. Sometimes duplicated entire copy. Somewhere was a thread explaining that but I still mess it up.

    This is helpful as is the rest of this response. What I find helpful here is the knowing that if *you* are struggling with this as I have, than I don't feel so bad about my not knowing. I have asked in similar UF threads, and have not really got answers.

    So, this is helpful and I will keep bumbling around trying different things until I think I have it right.

    Seasons Greetings, by the way.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

  6. #6
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Well, I tried fooling with some commands and got errors, before these commands worked:

    rsync -avr /home/mikodo/Desktop/Data_File /home/mikodo/Documents
    &
    rsync -avr /home/mikodo/Desktop /home/mikodo/Documents
    &
    This command worked to put the Data_File and contents in a partition in the usb external drive (it had to be the UUID, I found).

    sudo rsync -avr /home/mikodo/Desktop/Data_File /media/d24088a9-87e1-4148-b874-df41ce1dc0d1

    Following oldfred's stuff, I can make a /mnt/backup directory and mount my internal drive /dev/sda10 to it by the following two commands:

    sudo mkdir /mnt/backup
    &
    mount -t ext4 /dev/sda10 /mnt/backup

    but, I haven't figured out how the rsync command to transfer data to it like:

    sudo rsync -avr /home/mikodo/Documents /WHATEVER THE COMMAND IS to write to /dev/sda10

    And last then, I need to see how to rsync data from /dev/sada10 to a partition on my usb ext.drive ( /media/d24088a9-87e1-4148-b874-df41ce1dc0d1)
    Data_File is really a folder with a .odt file in it. I deleted the results, of the transfers!

    Now, I just need to figure out how to write rsync commands to copy data, to different partitions and drives. (well, I got the usb drive command figured).

    and ... copy data from partitions and drives to other partitions and drives.
    Last edited by mikodo; December 28th, 2013 at 10:46 AM.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

  7. #7
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    You just have to create a mount and mount that partition.
    Similar to my backup script does in post #2. Once you create a mount point it says in system unless you delete it. But I transfer script to new install and then forget to create mount and backup does not work as the mount does not exist, so I needed it in script.
    And I do not normally mount my backup partition and often reboot, so I have to make sure it is mounted. If already mounted it just gives an error that it is already mounted. If something you already have mounted in fstab then it is already mounted.
    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.

  8. #8
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Quote Originally Posted by oldfred View Post
    You just have to create a mount and mount that partition.
    Similar to my backup script does in post #2. Once you create a mount point it says in system unless you delete it. But I transfer script to new install and then forget to create mount and backup does not work as the mount does not exist, so I needed it in script.
    And I do not normally mount my backup partition and often reboot, so I have to make sure it is mounted. If already mounted it just gives an error that it is already mounted. If something you already have mounted in fstab then it is already mounted.
    Thanks Fred.

    Edit:

    I will try another day.

    I need to read through what you have written in post #2 and other guides.
    Last edited by mikodo; December 27th, 2013 at 09:16 PM.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

  9. #9
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 17.04 Zesty Zapus

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Have you tried grsync? You could run a simulation and make a note of the command it displays.

  10. #10
    Join Date
    Apr 2009
    Beans
    1,314
    Distro
    Xubuntu

    Re: RSYNC. Anyone want to write 3 commands with the paths?

    Quote Originally Posted by oldos2er View Post
    Have you tried grsync? You could run a simulation and make a note of the command it displays.
    No I haven't. Thanks. That may be an angle to pursue, cause I am not getting anywhere with moving data to different partitions or drives. I hope Grsync does that.
    One Psychiatrist's Definition of Insanity: Knowing what one should do and doing differently.

Page 1 of 3 123 LastLast

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
  •