v3.0.4 and OSXS - Exit code: 1

henri henri at stmargarets.school.nz
Sun Dec 13 15:21:27 MST 2009

> When launchd executed this command, it did not work.  The system.log file reads "Exited with exit code: 1".
> Can you redirect the output to a file so it can tell you why it failed?  e.g.  >file.out 2>&1
> One common thing that prevents non-interactive sudo is this tty setting: 
> Defaults    requiretty

I agree, it is very likely that sudo is asking for a password and this may be causing the "Exited with exit code:1" error message. 

On possible alternative is to issue the rsync command directly as root. 

This approach may not be suitable or even required in your setup. It will probably depend upon the owners and permissions of the files located within the /Volumes/File_Storage/docs/ directory on your system.

I would also suggest that you consider using the absolute path to the rsync command when it is run via LaunchD. Three common possibilities are listed below :


To find the absolute path to the version you are running, login to a shell on the server and issue the command below. You should find that the absolute path to the first rsync command in your search path will be returned : 

which rsync

The reason I suggest specifying an absolute path is because, when you login to a terminal, it is very common that a search path has been set. This search path will be used to locate many commands, such as rsync on your system. The search path provides a places to search and also order if more than one command exists with the same name. It is possible to have more than one command with the same name installed on a system. The search path set in the terminal may be different to the search path set when the command is executed from LaunchD. As such this is quite important.

To determine your path issue the following command : 

echo $PATH

It is quite likely that the search path returned is different when you are logged in to a terminal session differs from the search path provided when commands are started from LaunchD or cron.

More details are available from : http://en.wikipedia.org/wiki/PATH_(variable)

Hopefully this information is helpful and you will have your script working soon.

 This email is protected by LBackup, an open source backup solution. 
      Free as in freedom; LBackup is licensed under the GNU GPL
              Download LBackup now : http://www.lbackup.org

More information about the rsync mailing list