Raised This Month: $32 Target: $400
 8% 

[ANY] Full Cronjob Plugin [Execute commands on time intervals / game events]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
dordnung
Veteran Member
Join Date: Apr 2010
Plugin ID:
3474
Plugin Version:
2.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    56 
    Plugin Description:
    Allows to create cronjobs which can execute console, system or player commands on time intervals / game events
    Old 01-16-2013 , 20:59   [ANY] Full Cronjob Plugin [Execute commands on time intervals / game events]
    Reply With Quote #1

    Description:

    This plugin allows you to create cronjobs.

    With cronjobs you can execute commands on time intervals or events / game events.

    For time intervals the following intervals are possible: seconds, minutes, hours, days, months, day of week
    For events the following events are possible: plugin_start, plugin_end, map_start, map_end and every event available in the current game (see here)

    The syntax is similarly to the original cronjob syntax of Unix and just as easy to create!

    A cronjob can execute one of three different command types:
    1. Server console commands
      Execute commands on the server console
    2. System commands
      Execute commands on the shell with the system2 extension
    3. Player commands
      Players on the server will execute a command

    Note: Cronjobs will not be executed if your server is hibernating

    How to add cronjobs

    Taken from "cfg/cronjobs.txt":

    Code:
    // * * * * * * <typ> <command>
    // - - - - - - -     -
    // ¦ ¦ ¦ ¦ ¦ ¦ ¦     ¦
    // ¦ ¦ ¦ ¦ ¦ ¦ ¦     +-- The command to execute
    // ¦ ¦ ¦ ¦ ¦ ¦ +-------- Available types are: console (execute server command), system (execute system command with system2 extension), player (execute on player console)
    // ¦ ¦ ¦ ¦ ¦ +---------- Weekday (0-7, Sunday is 0 or 7)
    // ¦ ¦ ¦ ¦ +------------ Month (1-12)
    // ¦ ¦ ¦ +-------------- Day (1-31)
    // ¦ ¦ +---------------- Hour (0-23)
    // ¦ +------------------ Minute (0-59)
    // +-------------------- Seconds (0-59) - Optional, zero if not given
    //
    // Allowed syntax:
    // *        = All, wildcard
    // */x      = Every x sec/min/hour/day/month/weekday
    // x-y      = From x to y
    // x,y,z    = On x, y and z
    //
    // Examples:
    //
    // Loads a plugin on every 15. of the month and unloads it on the 16. again
    // 0 0 15 * * console sm plugins load myplugin
    // 0 0 16 * * console sm plugins unload myplugin
    //
    // Makes a backup of the server every three hours
    // * */3 * * * system tar zcvf backup.tar.gz "/home/user/server"
    //
    // Every player say: Why am i writing? At 15.20, 15.40, 16.20, 16.40, 17.20, 17.40, 20.20 and 20.40
    // 20,40 15-17,20 * * player say "Why am i writing ?"
    //
    // More examples here: http://www.thesitewizard.com/general/set-cron-job.shtml
    //
    // OR:
    //
    // @<special> <typ> <command>
    // -          -     -
    // ¦          ¦     ¦
    // ¦          ¦     +-- The command to execute.
    // ¦          +-------- Available types are: console (execute server command), system (execute system command with system2 extension), player (execute on player console)
    // +------------------- The special time to execute the command at. Has to start with a @ following the special
    //
    // Allowed specials: plugin_start, plugin_end, map_start, map_end and every event available in the current game ( see https://wiki.alliedmods.net/Game_Events_(Source) )!
    //
    // So for example this is valid:
    // @player_death player say "Oh! Someone died!"
    //
    // Just write your Cronjobs below this Line!

    How to install / use

    Just download the cronjobs.zip, extract it and put the cfg and addons folder to the gamdir of your server.

    Add your cronjobs to the cfg/cronjobs.txt and enable / disable logging in the cfg/sourcemod/plugin.cronjobs.cfg.

    Restart your server, change your map or load it with sm plugins load cronjobs.

    To use system commands you need the System2 extension!

    To enable auto updating you need the Updater plugin!

    You can reload the cronjobs from the cronjobs.txt file with the cronjobs_reload server command.


    Changelog
    • 2.0:
      • Added seconds to time interval
      • Added execution on events
      • Added possibility for updating
      • Add support for any whitespace
      • No limit for amount of cronjobs
      • Fixed some bugs
      • Ported to new sourcemod syntax
      • Moved convar config file to cfg/sourcemod/plugin.cronjobs.cfg
      • Updated for current System2 API
    • 1.2:
      • Updated for current System2 API
    • 1.1:
      • Fixed a bug, so that 00 didn't work
    • 1.0:
      • First Release

    Have fun and report any error!
    Attached Files
    File Type: zip cronjobs.zip (26.7 KB, 1199 views)
    File Type: sp Get Plugin or Get Source (cronjobs.sp - 565 views - 22.4 KB)
    __________________

    Last edited by dordnung; 11-16-2018 at 07:39.
    dordnung is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 01-17-2013 , 08:27   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #2

    Nice one
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 02-06-2013 , 08:17   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #3

    Update



    Code:
    1.1 
         -Fixed a bug, so that 00 didn't work
    __________________
    dordnung is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 02-06-2013 , 08:57   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #4

    Thanks! I've been using this plugin in place of an older one and it's working perfectly. Appreciate the work.
    Snaggle is offline
    sipster19
    Senior Member
    Join Date: Mar 2011
    Old 02-06-2013 , 23:55   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #5

    What's the difference between your plugin and the Server Crontab plugin?

    http://forums.alliedmods.net/showthread.php?t=60046
    sipster19 is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 02-07-2013 , 04:02   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #6

    1. The Syntax is similarly to the original cronjob syntax of Unix

    2. you have More options how to set up your cronjob (20,40 15-17,20 */2 * ). The crontab plugin only have for each option one number

    3. You can execute console, player and system commands
    __________________

    Last edited by dordnung; 02-07-2013 at 05:51.
    dordnung is offline
    Baron Rojo
    Senior Member
    Join Date: Dec 2011
    Old 02-13-2013 , 00:29   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #7

    Hi nice plugin did it support map events and map timer? If not could you add this feature?
    Thx

    Last edited by Baron Rojo; 02-13-2013 at 00:30.
    Baron Rojo is offline
    AlfredSpain
    Senior Member
    Join Date: Oct 2010
    Old 02-16-2013 , 15:18   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #8

    good work!

    working on my server
    AlfredSpain is offline
    M@ME
    Junior Member
    Join Date: Aug 2012
    Location: Winterpeg Manitoba
    Old 03-03-2013 , 20:33   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #9

    Is there a way for me to tell the script to change the name of my mapcycle.txt every day at 5pm?
    __________________
    M@ME is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 03-03-2013 , 22:09   Re: [ANY] Full Cronjob Plugin [Execute commands on time intervals]
    Reply With Quote #10

    Yes this should be possible with the System 2 Exension

    Add as a cronjob:

    0 17 * * * system mv <gamedir>/mapcycle.txt <gamedir>/<newname>.txt

    Replace <gamedir> with your gamedir, like cstrike, or tf or dod.
    Replace <newname> with the name to replace to.

    Give me a feedback whether it's working.
    __________________
    dordnung is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 00:58.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode