bankzy
June 30, 2021, 7:29pm
1
I'm trying to setup a cronjob in Vesta CP with my following script:
#!/bin/bash
if pidof -o %PPID -x “rclone-cron.sh”; then
exit 1
fi
rclone copy /home/admin/web/domain.com/public_html gdrive:public_html
exit
I've made the .sh executable and added the following command in Vesta CP cron jobs:
/home/rclone-cron.sh >/dev/null 2>&1
I'm trying to get this to run every Wednesday but it doesn't seem to run, can anyone help me please or advise me on what I maybe doing wrong?
asdffdsa
(jojothehumanmonkey)
June 30, 2021, 7:41pm
2
bankzy
June 30, 2021, 7:43pm
3
I already have the command in Vesta CP, the problem I have is it's not running.
asdffdsa
(jojothehumanmonkey)
June 30, 2021, 7:45pm
4
as this is not a rclone question and specific to vesta, perhaps best to post at
https://forum.vestacp.com/
I'd imagine that's based on some form of Linux as I've never heard of it.
Cron jobs require full paths to things because they have no environment.
So my upload script looks like:
#!/bin/bash
set -e
# RClone Config file
RCLONE_CONFIG=/opt/rclone/rclone.conf; export RCLONE_CONFIG
RCLONE_USER_AGENT=animosityapp; export RCLONE_USER_AGENT
# Local Drive - This must be a local mount point on your server that is used for the source of files
# WARNING: If you make this your rclone Google Drive mount, it will create a move loop
# and DELETE YOUR FILES!
# Make sure to set this to the local path you are moving from!!
LOCAL=/local
# Exit if running
if [[ $(pidof -x "$(basename "$0")" -o %PPID) ]]; then
echo "Already running, exiting..."; exit 1; fi
# Check for excludes file
if [[ ! -f /opt/rclone/scripts/excludes ]]; then
echo "excludes file not found, aborting..."; exit 1; fi
This file has been truncated. show original
bankzy
June 30, 2021, 7:49pm
6
I'm wondering if this is an issue with my script though or not? as I can run my rclone copy "/home/admin/web/domain.com/public_html" "gdrive:public_html" command in ssh perfectly fine.
bankzy
June 30, 2021, 7:50pm
7
I am running Centos 7 and Vesta CP if it's of any use.
jwink3101
(Justin Winokur)
July 1, 2021, 1:15pm
8
This is a really minor question but why do:
MYVAR=value; export MYVAR
vs
export MYVAR=value
Is there a difference?
1 Like
Nah, not really. Just old school I guess as I was in the habit of doing it that way rather than just one line.
I suppose I could clean that up for tidiness.
1 Like
system
(system)
Closed
August 31, 2021, 9:29am
10
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.