Skip to Main Content

Cloud Platform

Announcement

Testing banner

Failing to run "oci os object sync" in cron job

User_WQ9D0Jan 18 2023

Hi all,
I'm hoping someone can help with what's sure to be a misunderstanding of required env variables for the OCI command line tool and where they're stored...
To sync an OCI object storage bin and a local directory (for remote copies of database back-ups) I want to run"
oci os object sync --bucket-name db-backup --src-dir /backups/mysql
I can run this as a regular user, and I don't see anything OCI-related in my environment, but if I run this as part of a back-up script through cron, I get:
Error: Unable to retrieve namespace internally. Please provide the namespace using the option "--['namespace']".
I'm assuming this is because the root user who is running the cron job is not picking up some OCI related config that is being picked up when I run as an unprivileged user - is that right? If it's relevant, I'm doing this on an Ampere A1 instance.
Thanks,
Dave.

Comments
Post Details
Added on Jan 18 2023
0 comments
15 views