Search the Community

Showing results for tags 'cron'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 1 result

  1. So this guide will help to make autorestart of MTA Server on linux Debian or Ubuntu. This works on all servers, so you need program called "CRON" to make autorestart. The program utility Cron is a time-based job scheduler in Unix-like computer operating systems. Instructions: №1 Check to see if "Cron" is already installed. which cron №2 If a path is returned, example: "/usr/bin/cron", then Cron is installed. Skip to №4. №3 Install Cron by typing. apt-get install cron №4 Now that Cron is installed, check the time line of crontab. Each line of a crontab file represents a job, and looks like this: ┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday; │ │ │ │ │ 7 is also Sunday on some systems) │ │ │ │ │ │ │ │ │ │ * * * * * command to execute The syntax of each line expects a cron expression made of five fields, followed by a shell command to execute. For example i'll make autorestart every 24 hours. at time 03:00 By moscow time, before restart he will warn in 1 minutes about. (You can set your time zone by typing: dpkg-reconfigure tzdata) Create new crontab file (requirements nano, if you don't have install by typing apt-get install nano) crontab -e Send this example code using nano: 59 2 * * * screen -dr <NAME_OF_YOUR_SCREEN_WHERE_STARTED_MTA_SERVER> -p 0 -X stuff "$(printf "say Server will restart in 1 minute\r")" 00 3 * * * screen -dr <NAME_OF_YOUR_SCREEN_WHERE_STARTED_MTA_SERVER> -p 0 -X stuff "$(printf "shutdown\r")" 01 3 * * * screen -dr <NAME_OF_YOUR_SCREEN_WHERE_STARTED_MTA_SERVER> -p 0 -X stuff "$(printf "./mta-server\r")" Now save file with ctrl+x click y then click enter. File created, so all files crontab which makes commands by time located in /var/spool/cron/crontabs №5 Restart cron service by typing service cron restart Now MTA Server Should to make autorestart every 24 hours at 03:00 Moscow time. If you have problems with this, send to this thread your problem and i will reply.