This is my rsync.sh in the home directory of my backup user
$ cat rsync.sh
#!/bin/sh
rsync -avvvz --stats --log-file="/var/log/rsync_client.log" -e "ssh -i /mnt/stor0/backup/backup-rsync-key" /mnt/stor0/home/ nas@remotehost:/mnt/backup/
when I run ./rsync.sh as backup user on the shell it works as it should (passwordless)
$ ./rsync.sh
opening connection using: ssh -i /mnt/stor0/backup/backup-rsync-key -l nas remotehost rsync --server -vvvlogDtprze.iLsf . /mnt/backup/
sending incremental file list
[sender] make_file(.,*,0)
.
.
.
list of files to backup
Now my cronjob
<job>
<enable/>
<uuid>1c7ad7f4-0daa-477b-9e7b-eb7e5861e3d3</uuid>
<desc>run backup to nas</desc>
<minute>0</minute>
<hour>4</hour>
<day/>
<month/>
<weekday>1</weekday>
<weekday>3</weekday>
<weekday>5</weekday>
<all_mins>0</all_mins>
<all_hours>0</all_hours>
<all_days>1</all_days>
<all_months>1</all_months>
<all_weekdays>0</all_weekdays>
<who>backup</who>
<command>/mnt/stor0/backup/rsync.sh</command>
</job>
When I try to run the job, it fails and client.log shows
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
Why is the command running when I execute it manually and why does it fail as cronjob on NAS4Free?