rsync on 8.01beta4 problems

Discussion in 'New to FreeNAS?' started by SLIMaxPower, Aug 13, 2011.

  1. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
    SLIMaxPower, Aug 13, 2011

    Hi I am running freenas 8.01BETA4 on a hpmirco.

    I have 3 zfs volumes 4tb each stripe. I want to rsync one of these volumes to another as a backup. I have tried using webgui but it doesnt seem to be working, I tried ssh into the machine and tried this rsync --partial --stats --progress -r -avz -e ssh /mnt/Pool2/ /mnt/Pool3Backup/ , and got permission denied (13)

    cheers
  2. Offline

    Tekkie

    Member Since:
    May 31, 2011
    Messages:
    332
    Message Count:
    332
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Development & Technology Management,
    Location:
    Santa Monica
    Tekkie, Aug 13, 2011

    The only of doing this in the GUI would be to create a CRON job, the 'rsync' GUI feature is for the daemon and thus remote backup.

    As for the shell rsync not working my guess is that you cannot read/write the locations.

    Try to do a 'ls -l /mnt/Pool2/' and 'ls -l /mnt/Pool3Backup/' if that works try 'touch /mnt/Pool3Backup/test.txt' if that all works then the problem may be somewhere deeper on the '/mnt/Pool2/' side where your account doesn't have read access.

    PS. I'd go with the CRON job option as it runs as root... ;)
  3. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
    SLIMaxPower, Aug 13, 2011

    it looks like /mnt/Pool2 has full permissions whereas /mnt/Pool3Backup only has drwx - and the error i saw was on that side

    so its a chmod ? i need to do ?
  4. Offline

    Tekkie

    Member Since:
    May 31, 2011
    Messages:
    332
    Message Count:
    332
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Development & Technology Management,
    Location:
    Santa Monica
    Tekkie, Aug 13, 2011

    Carefull you might get your FreeNAS UI (DB) out of sync if you do it from the shell, compare the permissions between the two pools in the UI, should be the same for this to work for you.
  5. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
    SLIMaxPower, Aug 13, 2011

    hmmm. so whats the best way to backup one volume to another daily ?
  6. Offline

    Tekkie

    Member Since:
    May 31, 2011
    Messages:
    332
    Message Count:
    332
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Development & Technology Management,
    Location:
    Santa Monica
    Tekkie, Aug 13, 2011

    System -> CronJobs -> rsync command.

    Or if you want an email sent on completion you could do what I did:
    Code (text):
    1. #!/bin/sh
    2. SHELL=/bin/sh
    3. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
    4.  
    5. cd /mnt/storage1/scripts
    6.  
    7. echo "Subject: Shrek's Backup report for: /mnt/storage1/$2/" > ./tmp/$2_tmpmail
    8. printf "\n" >> ./tmp/tmpmail
    9.  
    10. rsync -$1 --delete /mnt/storage1/$2/ /mnt/backup1/$2 >> ./tmp/$2_tmpmail
    11.  
    12. msmtp --file=${msmtp_config:-"/etc/local/msmtprc"} ***xx.***xx@gmail.com < ./tmp/$2_tmpmail
    Save this script on one of your pools and then enter a command like this in the CronJob UI:
    Code (text):
    1. /mnt/storage1/scripts/backup.sh avc home
  7. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
    SLIMaxPower, Aug 13, 2011

    I made a cron but it doesn't look like its working.

    ps -ux displays at least 3 rsyncs I have done from shell.

    email isn't working either. Is this just BETA issues ?

    I was having more luck FTPing and transferring via smb shares....
  8. Offline

    Tekkie

    Member Since:
    May 31, 2011
    Messages:
    332
    Message Count:
    332
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Development &amp; Technology Management,
    Location:
    Santa Monica
    Tekkie, Aug 13, 2011

    Search the forum for how to setup the email ;) and the CRON job will only run on the specified day/hour/interval.
  9. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
  10. Offline

    SLIMaxPower

    Member Since:
    Aug 13, 2011
    Messages:
    10
    Message Count:
    10
    Likes Received:
    0
    Trophy Points:
    1
    SLIMaxPower, Aug 13, 2011

    email is tested and setup i setup cron but im not sure the task is running. how can i check progress ?
  11. Offline

    Tekkie

    Member Since:
    May 31, 2011
    Messages:
    332
    Message Count:
    332
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Development &amp; Technology Management,
    Location:
    Santa Monica
    Tekkie, Aug 13, 2011

    The easiest way to check the cron job (yes I know the UI could have an option to run now) is to schedule it to run every 5 minutes, every hour, every day, this should trigger the job while you are at your PC to check, afterwards change the schedule to what you want it to be.

Share This Page