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 9214187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:55:16+00:00 2026-06-18T01:55:16+00:00

I have a fairly light script that I want to run periodically in the

  • 0

I have a fairly light script that I want to run periodically in the background every 5 hours or so. The script runs through a few different websites, scans them for new material, and either grabs .mp3 files from them or likes songs on youtube based on their content. There are a few things I want to achieve with this program that I am unsure of how to attain:

  • Have the program run every 5 hours — I’m not to familiar with system-level timing operations.
  • Have the program efficiently run in the background — I want these ‘updates’ to occur without the user knowing.
  • Have the program activate on startup — I know how I would set this up as a user, but I’m not sure how to add such a configuration to the python file, if that’s even possible. Keep in mind that this is going to be a simple .py script — I’m not compiling it into an executable.

The program is designed mainly with OSX and other Unix based systems in mind. Any advice on achieving some of these goals?

  • 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-18T01:55:17+00:00Added an answer on June 18, 2026 at 1:55 am

    If your script doesn’t need to be constantly in execution, and it sounds like it doesn’t, I’d suggest you set up a cron job.

    On a typical Linux box, you can edit your crontab file via:

    $ crontab -e
    

    This will open your crontab in your standard editor and install the crontab file for you after you’re done (i.e. you save it)

    A typical crontab command looks like:

    # m h  dom mon dow   command
     15  0   *   *   *    /bin/bash /home/yourself/bin/dump_my_tables.sh
    

    this line will execute dump_my_tables.sh every day at 00:15. Your script will need a like like the following:

    0  */5  *  *  *   /usr/bin/python /home/yourself/bin/scrape_the_web.py
    

    nb:

    • Time is the machine’s local time (!)
    • Some cron versions don’t accept */5 syntax, you have to manually specify the hours when you want the script to be scheduled, i.e. 0,5,10,15,20
    • You might want to redirect output, but it’s out of this answers’ scope
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple web2py form with a few validators like, IS_FLOAT_IN_RANGE(...) on
I have a fairly standard OLTP normalised database and I have realised that I
Hi I have been working on a fairly simple page with very light and
I have fairly large 4D arrays [20x20x40x15000] that I save to disk as HDF5
Have a fairly basic template that outputs the main article and then should output
I have fairly complex HTML document to generate that is of the form <head>
Given that most real world applications have fairly complicated relationships between entities, is there
I have a fairly complex model for one of my pages; it's made of
I have a fairly basic data.table in R, with 250k rows and 90 columns.
I have a fairly simple question, however the answer seems to elude me. If

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.