LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-03-2011, 08:18 AM   #1
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Rep: Reputation: 1
Strange RSYNC behaviour via FreeNAS 0.7.2 Sabanda (revision 5637)


Sorry for the vague topic/subject but that's the best way to describe my issue!
I have created a very simple SH script which is copied below.

Code:
#!/bin/sh
LOG_FILE=/myfolder/backup.log
rsync -avz /it_data backupuser@192.168.1.23:/backup/ >> $LOG_FILE 2>&1
If I log in as the local user "bob" and run it, it works 100% however, (I have shared SSH authorized_keys which means I don't need to enter a password for the SSH connection). The problem comes when I try to run the script via FreeNAS CRON.

Despite me telling it to use the user "bob", I get the following errors in the LOG_FILE ...

Quote:
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
Does anyone have any ideas or experience with this that could help me out?
Thank you in advance and for taking the time to read this post.
 
Old 10-03-2011, 08:59 AM   #2
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
UPDATE: I amended the SH script above to perform two additional actions:-
1. delete the existing $LOG_FILE
2. touch a new $LOG_FILE

Seems that despite me telling FreeNAS to run as the user "bob", the file is created by user "root" which may explain the failed passwordless SSH connection attempt ...

Code:
-rw-r--r--   1 root        managergroup      515 Oct  3 14:49 backup.log
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Random, very odd behaviour crashing rsync switch10 Linux - Desktop 4 04-14-2010 01:19 AM
weird rsync -avz behaviour centguy Linux - Software 3 02-01-2010 11:14 PM
svn restore directory to a revision also removing files not part of revision Four Linux - Software 1 03-03-2009 04:18 PM
rsync - inefficient behaviour? Unclesmiff Linux - Software 4 01-02-2008 11:13 AM
is this normal rsync behaviour? nass Slackware 5 05-03-2007 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration