Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8924469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:25:32+00:00 2026-06-15T07:25:32+00:00

Generally, when I need to use Environmental Variables in a Cron job, I just

  • 0

Generally, when I need to use Environmental Variables in a Cron job, I just declare them in the cron tab. However, Im working on a server where I don’t have direct access to the the cron tab. I was told I can use a bash script to set the variables for the cron job. I’m not too familiar with bash, and I’m not quite sure what the flow of commands is.

My cron job is going to execute a Php script once a week. So I need a separate cron job to run a bash script? What would this bash script look like?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:25:34+00:00Added an answer on June 15, 2026 at 7:25 am

    If you don’t have access to change the crontab, then you have to change the PHP script. You have to change one or the other.

    You can replace the PHP script with a bash script that sets the environment variables and then calls the PHP script in its new home. But then you have to move the PHP script and give the bash script the PHP script’s old name.

    At least, that is the case unless you can have the cron job modified to call the bash script instead of the PHP script. But if you can do that, I don’t know why you can’t have the environment variable setting added.

    In any case, there’s no way a separate script run independently can set environment variables on behalf of the cron job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use python on a big server where I don't have root
I'm developing the architecture diagram for a system and i need to use generally
General use case I am trying to implement a basic shell. Description I need
I generally need to do a fair amount of text processing for my research,
I need an idiots guide explanation to understand generally how do you authenticate users
I need to use a string/shortcode in a CMS text area to define a
When using Boost.Test, there is generally no need to define a main() function, since
I'm working on upsizing a suite of MS Access backend databases to SQL Server.
a newbie django question I want to use 3rd party app, but I need
For one of the projects I'm working on, I have to use DOM Inspector

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.