1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

1.21 (obsolete) TShock cron command 1.0.6.21

TShock version of Unix cron scheduling processor for commands.

  1. GrandPa-G
    API Version:
    21
    TShock Version:
    4.3.9
    Source URL:
    https://github.com/Grandpa-G/TShockCron
    Cron command

    This command processes a file in the crontab format recognized by various Unix like cron schedulers. A file named crontab.txt will be created in the TShock folder or can be manually created if desired. The format is the same as all other crontab formats.

    The crontab format is
    Code:
    ===Configuration file===
    # * * * * *  command to execute
    # │ │ │ │ │
    # │ │ │ │ │
    # │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
    # │ │ │ └────────── month (1 - 12)
    # │ │ └─────────────── day of month (1 - 31)
    # │ └──────────────────── hour (0 - 23)
    # └───────────────────────── min (0 - 59)
    
    A full description of the various options is located at http://en.wikipedia.org/wiki/Cron Some of the advanced options are not supported such as the Nonstandard predefined scheduling definitions. Examples of various combinations are given at http://code.google.com/p/ncrontab/wiki/CrontabExamples One exception is the support of the @reboot nonstandard option.

    An additional schedule option is supported as documented as alternative crontab options. If a line in the crontab.txt file starts with the phrase @reboot then any command following (separated by a space) will be executed at the time a TShock server starts. This command will only be executed only one time and not be scheduled in the future. This line will be ignored if the -reload option is used.

    The command options for cron are:
    • -reload/-r reloads options from crontab file
    • -stop/-s stops all future cron events
    • -edit/-e invokes the GUI CronTab file editor
    • -delete/-d <n>deletes the nth scheduled event, use -list for <n>"
    • -verbose/-v show details
    • -!verbose/-!v don't show details
    • -preview/-p show schedule details without scheduling
    • -!preview/-!p negate preview mode
    • -list/l show current cron criteria
    • -help this information
    The reload option is how to get the crontab started. Also, if any changes are made, then the reload option is necessary to effect the changes. All previous schedules will be discarded and the new schedules as defined by the crontab will be instituted. The crontab file can be manipulated with and text editor as long as it is kept in standard text format.

    Using the preview option is a good way to test your crontab.txt file to see if it is valid and also see when the next scheduled event will occur.

    Currently the cron command can only be executed at the server console.

    The file NCrontab.dll must also be present in the ServerPlugins folder to all this plugin to function. This file is the main parser of the crontab options. Without this work, the cron plugin would not have been created. Many thanks to the author. http://code.google.com/p/ncrontab/
    // NCrontab - Crontab for .NET
    // Copyright (c) 2008 Atif Aziz. All rights reserved.
    //
    // Author(s):
    //
    // Atif Aziz, http://www.raboof.com
    //
    // Licensed under the Apache License, Version 2.0 (the "License")
    Kojiro_S likes this.