How to schedule a task to linux server system using php script? For example, I need php script to schdule a task for system to run bash script which will backup my files to zip archive? Is there a way to do it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you have access to ssh on that machine you can simply schedule your task using linux’s crontab. While logged in, type
crontab -ewhich will bring up an editor with the current cron jobs for that user. The syntax is simple, it is composed from 6 parameters, an example line would be :the parameters stand for :
and the command above will run
at_every_minute of_every_hour any_day_of_the_month of_every_month any_day_of_the_weekIf you would like to schedule a task to run at 5:05 am on all mondays of every month it will be something like :
A really nice tool is http://corntab.com which will help you schedule your command.