PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 16, 2022

[FIXED] Schedule Automatic Server Maintenance [Ubuntu]

 March 16, 2022     apache, lamp, linux, php, ubuntu     No comments   

Issue

I'm running an Ubuntu 12.10 server as a LAMP stack. I access this through a SSH terminal (as I don't have access to the physical box).

My question is, is there a way to setup ubuntu to automatically execute a script at chosen times. Like to schedule automatic maintenance scripts that have been built in PHP or really any language (possibly Bash Scripts?). I'm sure this has to be possible.

Since I am a bit newer to linux/ubuntu, any help would be appreciated.

EDIT: This is one solution I found if anybody else stumbles across this...

sudo crontab -e
...
@daily /usr/bin/wget -q -O /var/log/maintenence.txt /var/www/admin/script.php

Solution

You can use the crontab in linux.. That wil suit your purpose. Cron is a daemon that executes scheduled commands eg:

# Minute   Hour   Day of Month       Month          Day of Week        Command    
# (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)                
0        2          12             *               0,6           /usr/bin/find


Answered By - Konza
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing