Edit crontab in jail

Status
Not open for further replies.

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
*/1 * * * * bash -I -c "/root/sync.sh >/tmp/stdout_2.txt 2>/tmp/stderr_2.txt"

that is what I have in crontab -e

Without the bash -c it won't run, and I get the same mirror error with -I or without.
I also note the OP is using bash too...
 

babaz83

Dabbler
Joined
Nov 10, 2014
Messages
19
I also note the OP is using bash too...
Tried also changing everything to /bin/sh nothing works.

This is the log from Cron


Aug 22 14:28:00 rclone /usr/sbin/cron[35591]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:28:00 rclone /usr/sbin/cron[35592]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:29:00 rclone /usr/sbin/cron[35635]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:29:00 rclone /usr/sbin/cron[35636]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:30:00 rclone /usr/sbin/cron[35662]: (root) CMD (/usr/libexec/atrun)
Aug 22 14:30:00 rclone /usr/sbin/cron[35663]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:30:00 rclone /usr/sbin/cron[35664]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:31:00 rclone /usr/sbin/cron[35708]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:31:00 rclone /usr/sbin/cron[35709]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:32:00 rclone /usr/sbin/cron[35739]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:32:00 rclone /usr/sbin/cron[35740]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:33:00 rclone /usr/sbin/cron[35782]: (root) CMD (/usr/share/test.sh 2>&1 >/var/log/test.txt)
Aug 22 14:33:00 rclone /usr/sbin/cron[35781]: (root) CMD (root /bin/sh -x /usr/share/RcloneBzSync.sh >/var/log/cron.txt 2>&1)
Aug 22 14:35:38 rclone crontab[36006]: (root) BEGIN EDIT (root)
Aug 22 14:37:38 rclone crontab[36006]: (root) END EDIT (root)
Aug 22 15:51:23 rclone crontab[39287]: (root) BEGIN EDIT (root)
Aug 22 15:51:36 rclone crontab[39287]: (root) REPLACE (root)
Aug 22 15:51:37 rclone crontab[39287]: (root) END EDIT (root)
Aug 22 15:55:00 rclone crontab[39462]: (root) BEGIN EDIT (root)
Aug 22 15:55:46 rclone crontab[39462]: (root) REPLACE (root)
Aug 22 15:55:47 rclone crontab[39462]: (root) END EDIT (root)
Aug 22 15:55:48 rclone crontab[39581]: (root) BEGIN EDIT (root)
Aug 22 15:55:52 rclone crontab[39581]: (root) END EDIT (root)
Aug 22 15:56:38 rclone crontab[39602]: (root) BEGIN EDIT (root)
Aug 22 15:56:47 rclone crontab[39602]: (root) END EDIT (root)

 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
So cron (/var/log/test.txt?) shows the script being run every minute. I'm presuming the other file (/var/log/test.txt) shows nothing?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Try just the following command in the crontab: env > /var/log/env.txt
Also, did the previous attempt include a newline at the end? I recently saw the lack of that as a reason for a cron job not running.
 

babaz83

Dabbler
Joined
Nov 10, 2014
Messages
19
Try just the following command in the crontab: env > /var/log/env.txt
Also, did the previous attempt include a newline at the end? I recently saw the lack of that as a reason for a cron job not running.
Hi thank you again for your support.
Unfortunately I did try all the tests you've suggested but nothing happen, no file is generated or filled.
The only result I have is the defaut cron log that I've showed you on the previous post.
This what I have inside crontab


root@rclone:/var/log # crontab -l
SHELL=/bin/sh
PATH=/usr/share:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
* * * * * env > /var/log/env.txt
* * * * * sh -x /usr/share/RcloneBzSync.sh
0 0 * * * root /usr/local/sbin/anacron




If you like I can give access through teamviewer I really don't know how to fix this.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I'd be willing to try teamviewer or skype. I'll send a message to see if we can set something up.
 
Status
Not open for further replies.
Top