A
A
Anton Misyagin2015-12-08 10:05:07
linux
Anton Misyagin, 2015-12-08 10:05:07

Command not found, how so?

With my hands I enter the
backup perform --trigger mybackup command,
the program starts up and does everything as it should. I'm running as a user who is in the sudo
which backup group

/home/deployer/.rvm/gems/ruby-2.1.5/bin/backup

I'm trying to register in cron
crontab -e (I'm running it as the same user)
* * * * * backup perform --trigger mybackup >> out 2>&1 I'm
trying shells: sh, bash I'm
looking at what's in out:
/bin/sh: 1: backup: not found
/bin/sh: 1: backup: not found
/bin/sh: 1: backup: not found
/bin/bash: backup: command not found

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Burov, 2015-12-08
@BuriK666

specify the full path.
or add /home/deployer/.rvm/gems/ruby-2.1.5/bin in cron to PATH

K
krypt3r, 2015-12-08
@krypt3r

Obviously, in the crontab you need to write the full path to the binary. to the out file too

V
Vladimir Zhurkin, 2015-12-08
@icCE

You need to run crontab as the deployer user.
crontab [-u user] file
List
crontab -l
for more details man crontab

V
Vlad Zhivotnev, 2015-12-08
@inkvizitor68sl

Your .bashrc PATH most likely has a non-standard one.
In crontab - pure sh. Change PATH in crontab file too.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question