Rsync task error - Term undefined variable

Status
Not open for further replies.

Joerg G

Dabbler
Joined
Jan 7, 2015
Messages
16
Dear *,

I created an Rsync task to push backups to a cloud storage provider that supports Rsync via SSH. However I can't get this to work, regardless of what I configure I always get the following error message in the log:
Code:
Jan  6 22:51:47 freenas rsync: TERM: Undefined variable.
Jan  6 22:51:47 freenas rsync: Ambiguous output redirect.

Unselecting the Quiet Option I got rid of the second error message already.

A test rsync run with same values as in the freenas web form in the shell did work, public keys have been provided to the remote user and remote machine's key has been added to known_hosts as well. All this is run via root user.

The crontab command generated from the freenas web form is as follows:
Code:
0006**6,7rootPATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/bin/lockf -s -t 0 -k '/mnt/zroot/blablabla' /usr/local/bin/rsync -r -t -z --delete-delay --delay-updates  -e 'ssh -p 22 -o BatchMode=yes -o StrictHostKeyChecking=yes' '/mnt/zroot/blablabla' remoteuser@remoteserver:'/remotepath' 2>&1 |/usr/bin/logger -t rsync

I run newest freenas version with latest updates applied (FreeNAS-9.3-STABLE-201412312006).

From what I've already tried and searched it points me to a similar if not same problem as described in
https://forums.freenas.org/index.php?threads/term-undefined-variable.14220/

--> TERM variable does not seem to be assigned at runtime of rsync crontab

So, how can I get around this issue?

Thanks a lot for any ideas...

Cheers,
Joerg
 
Last edited:

Joerg G

Dabbler
Joined
Jan 7, 2015
Messages
16
Nobody a clue?
 

stefanb

Patron
Joined
Dec 12, 2014
Messages
200
Same problem for me!
I've done everything exactly like explained in manual.

Console ssh connection from clinet to server is ok

Client is FreeNAS-9.3-STABLE-201501090144
Server is FreeNAS-9.3-STABLE-201501151844

I need a hint :)

Regards

Stefan
 

Joerg G

Dabbler
Joined
Jan 7, 2015
Messages
16
The good thing is that regardless of this error the rsync task is starting and also finishing successfully.
Just make sure to unselect the quiet option before manually starting it.
Have not yet checked if this is also valid for scheduled rsync task via cron though.
 

knormoyle

Dabbler
Joined
Apr 19, 2015
Messages
14
I saw the same thing when I did a rsync task (using rsync module at the server) ..i specified a user 'rsync' who is a valid user a the rsync server. I had to put it's password in a file with options in the rsync task

I got the TERM message above in the system log..

I looked for where TERM might be defined in all the .* files in the home dirs of the users
.shrc
.cshrc
.login

(use ls -ltra to see all in home dir)
I normally setup users to use bash as shell, but notice the setup prefers csh, so just in guess I looked at .profile (which all use?)

it has this
# Setting TERM is normally done through /etc/ttys. Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# TERM=xterm; export TERM


so that's suspicious..commented out. I'm going to try uncommenting that.
 

knormoyle

Dabbler
Joined
Apr 19, 2015
Messages
14
Oh, the 'rsync' I created on the freenas (only because the gui wouldn't let me specify a username = rsync unless the user existed locally, even though I just want to give that user to the remote rsync server...

well I made him /nonexistent for home directory. Maybe I need a home directory for him, so TERM gets set (I'm assuming the task is run as that user? maybe it's run as root, dunno yet) [UPDATE]. Yeah the task is run as that user 'rsync'. I specified a log and it's created with his user name


[... /mnt/mr2-pool/rsync]$ ls -ltr
-rw-r----- 1 rsync rsync 6 Apr 19 01:13 rsync.pswd
-rw-r--r-- 1 rsync wheel 272 Apr 19 01:42 rsync_to_another.log

the 'Extra options' I specified in the rsync task gui, were
--password-file=/mnt/mr2-pool/rsync/rsync.pswd --log-file=/mnt/mr2-pool/rsync/rsync_to_another.log

where rsync.pswd had the password to give to the rsync server.

[UPDATE]
so I added a home dir to the user 'rsync' and then I had to copy the \.* files from another user (like .profile) and chown rsync:rsync them. But then I could uncomment the TERM in the .profile for user 'rsync'

to show that user gets TERM set now

$ su - rsync
Password:
[rsync@mr2~]$ export $TERM
[rsync@mr2 ~]$
 
Last edited:
Status
Not open for further replies.
Top