Hello all,
good day.
im fairly new to rclone and ive been having some issues when running this as root on a bash script on my ubuntu server.
ive got the following script:
#! /bin/bash
exec 2>/home/username/trace-$$.log
set -x
find /media/backup/ -type f -name "databases_" -daystart -ctime +4 -delete
find /media/backup/ -type d -name "nextcloud-bak" -daystart -ctime +4 -exec rm -r {} +
find /media/backup/ -type d -name "apache-bak*" -daystart -mtime +4 -exec rm -r {} +
sudo -u www-data /var/www/html/nextcloud/occ maintenance:mode --on
rsync -Aaxh /var/www/html/nextcloud/ /media/backup/Nextcloud-bak/nextcloud-bak_date +'%m-%d-%Y'
/
mysqldump --all-databases > /media/backup/MySQL-bak/databases_date +'%m-%d-%Y'
.sql
rsync -Aaxh /etc/apache2/sites-available/ /media/backup/Apache-conf-bak/apache-bak_date +'%m-%d-%Y'
/
sudo -u www-data /var/www/html/nextcloud/occ maintenance:mode --off
RCLONE_CONFIG=/home/username/.config/rclone/rclone.conf
rclone sync /media/backups OneDrive:Backups
rclone sync /home/username/trace-$$.log OneDrive:
and for some reason, i get the following errors whe its ran with crontab as root
Failed to create file system for "OneDrive:Backups": unable to get drive_id and drive_type - if you are upgrading from older versions of rclone, please run rclone config
and re-configure this backend
rclone sync /home/username/trace-30024.log OneDrive:
2020/01/14 01:00:04 Failed to create file system for "OneDrive:": unable to get drive_id and drive_type - if you are upgrading from older versions of rclone, please run rclone config
and re-configure this backend
if i run this on a single script as root it works fine
#! /bin/bash
RCLONE_CONFIG=/home/username/.config/rclone/rclone.conf
rclone sync /media/backups OneDrive:Backups
rclone sync /home/username/trace-$$.log OneDrive:
can you please help me by letting me know if im missing something?
does the RCLONE_CONFIG need to go below #! /bin/bash?
thanks a lot for your advise