Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Cron job not running

General questions about VestaCP
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
HenrysCat
Posts: 51
Joined: Sun Mar 25, 2018 7:25 pm

Os: CentOS 6x
Web: apache + nginx
Cron job not running
  • Quote

Post by HenrysCat » Wed Apr 11, 2018 8:43 am

I have searched this forum and tried many solutions but I just can't get it to work.

I have a script here /home/admin/web/mydomain/public_html/rclone-cron.sh as below to use rclone to backup to Backblaze

Code: Select all

    #!/bin/bash

    if pidof -o %PPID -x "rclone-cron.sh"; then
    exit 1
    fi
    rclone sync /home/admin/web/mydomain/public_html/ remote:bucket
    exit
If I run

Code: Select all

/home/admin/web/mydomain/public_html/rclone-cron.sh
from a terminal (logged in as admin) the backup runs no problem.

Howver I cannot get it to run in cron, command as below,

Code: Select all

sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
I have checked the cron log in /var/log and find the lines,

Code: Select all

Apr 11 06:00:01 vultr CROND[6886]: (admin) CMD (sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
But no backup perfomed, only when I run the command from a terminal does the backup run.
Any ideas?
Top

yoko eagle
Posts: 33
Joined: Sat Jan 20, 2018 3:45 am

Os: Debian 8x
Web: apache + nginx
Re: Cron job not running
  • Quote

Post by yoko eagle » Wed Apr 11, 2018 9:19 am

HenrysCat wrote: ↑
Wed Apr 11, 2018 8:43 am
I have searched this forum and tried many solutions but I just can't get it to work.

I have a script here /home/admin/web/mydomain/public_html/rclone-cron.sh as below to use rclone to backup to Backblaze

Code: Select all

    #!/bin/bash

    if pidof -o %PPID -x "rclone-cron.sh"; then
    exit 1
    fi
    rclone sync /home/admin/web/mydomain/public_html/ remote:bucket
    exit
If I run

Code: Select all

/home/admin/web/mydomain/public_html/rclone-cron.sh
from a terminal (logged in as admin) the backup runs no problem.

Howver I cannot get it to run in cron, command as below,

Code: Select all

sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
I have checked the cron log in /var/log and find the lines,

Code: Select all

Apr 11 06:00:01 vultr CROND[6886]: (admin) CMD (sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
But no backup perfomed, only when I run the command from a terminal does the backup run.
Any ideas?
replace sudo with /bin/sh or /usr/bin/sh
if still not working try to chmod the file

Code: Select all

chmod +x /home/admin/web/mydomain/public_html/rclone-cron.sh
Top

HenrysCat
Posts: 51
Joined: Sun Mar 25, 2018 7:25 pm

Os: CentOS 6x
Web: apache + nginx
Re: Cron job not running
  • Quote

Post by HenrysCat » Wed Apr 11, 2018 11:02 am

replace sudo with /bin/sh or /usr/bin/sh
if still not working try to chmod the file

Code: Select all

chmod +x /home/admin/web/mydomain/public_html/rclone-cron.sh
Tried both no joy, rclone-cron.sh permissions are 755, as I said it runs manually from terminal logged in as admin, just not in cron.
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password