linuxunixcron

How do I set up cron to run a file just once at a specific time?


How do I set up cron to run a file just once at a specific time? One of the alternatives is at but it is not accessible to all users on standard hosting plans. Therefore I was wondering whether there is way to do it using cron?


Solution

  • Try this out to execute a command on 30th March 2011 at midnight:

    0 0 30 3 ? 2011  /command
    

    WARNING: As noted in comments, the year column is not supported in standard/default implementations of cron. Please refer to TomOnTime answer below, for a proper way to run a script at a specific time in the future in standard implementations of cron.