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

  • Home
  • SEARCH
  • 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 855709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:07:18+00:00 2026-05-15T08:07:18+00:00

I have a backup system….. that backs up a folder every 5 minutes. The

  • 0

I have a backup system….. that backs up a folder every 5 minutes. The backup can be assigned to any device using its IP Address. But once a week or once a month that device is rebooted, and we want to turn the backup off every week or month on a certain time for certain seconds. Creating the database table shouldn’t be a problem, I was wondering if there is any way we can do this in a function

The Tables are structured as below

Device

Id     BIGINT(20),    //Auto Increment Id of the Device
Name   VARCHAR(255),  //Name of the device
Backup TINYINT(1)     //Boolean to represent weather the device is backed or not

TurnOffBackup

Id        BIGINT(20),  //Id of the Table
deviceId  BIGINT(20),  //DeviceId Foriegn Key
weekDay    TINYINT(1), //The week day to turn it off
monthDate INT(2),      //The month date to turn it off
fortime   BIGINT(20)   //The number of seconds to turn the device off for

At the moment my select for devices to be backedup are as follows

SELECT * FROM Device WHERE backup=1

What i wana achieve is

SELECT * FROM Device WHERE backup=1 AND TURNBACKUPOFF(Device.Id)=0

Any idea how i would do this or should i be considiring doing this in code rather than in a MySQL Function

  • 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-05-15T08:07:18+00:00Added an answer on May 15, 2026 at 8:07 am

    I’d use id INT and backupEnabled BOOLEAN, and use a cron script or Quartz to enable/disable backups. More precisely, I’d update this from the same script which is causing the reboot. Duplicating the time of reboot is useless and error-prone.

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

Sidebar

Related Questions

No related questions found

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.