# [FreeNAS] Unison cron command



## XIII (Feb 20, 2011)

I am using FreeNAS and can not get unison to work via cron. I am trying to automate the syncing between two FreeNAS devices.
Command I am using:

[cmd=]/usr/local/bin/unison -batch /mnt/Docs ssh://root@192.168.3.23:33//mnt/Docs[/cmd]

This command does not work, can it only be done using a a script? If so what would a script for this look like?


----------



## DutchDaemon (Feb 20, 2011)

For the record: Topics about PC-BSD | FreeNAS | DesktopBSD | m0N0WALL | pfSense | Debian GNU/kFreeBSD.


----------



## XIII (Feb 20, 2011)

I asked this same question on the FreeNAS forums and have not gotten any response, so I am asking it here.


----------



## jrm@ (Feb 20, 2011)

Does the command work when you execute it at the shell prompt?  Does it require interaction such as passwords?
Can you verify the cron job is running?  What do you see in the cron output either from logs or what gets mailed to you (if you have set MAILTO)?


----------



## XIII (Feb 21, 2011)

> Does the command work when you execute it at the shell prompt?



Yes, both local and remote shells



> Does it require interaction such as passwords?



No I set it up via key based SSH



> Can you verify the cron job is running?
> What do you see in the cron output either from logs or what gets mailed to you (if you have set MAILTO)?



After clicking run now I get: 
	
	



```
Failed to execute cron job.
```
In the logs I get: 
	
	



```
root: Failed to execute cron job '/usr/local/bin/unison -batch /mnt/Docs ssh://root@192.168.3.23:33//mnt/Docs'
```


Thank you for your help.


----------

