Skip to content

Instantly share code, notes, and snippets.

@colingourlay
Last active December 26, 2015 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colingourlay/7095968 to your computer and use it in GitHub Desktop.
Save colingourlay/7095968 to your computer and use it in GitHub Desktop.
Grunt task for cycling through each item in a directory on an interval and creating a symlink which points to it. This is helpful for cycling through logs, or an archive of data captured over time. Coupled with a server, it serves as a good simulated data endpoint. This should be defined after grunt.initConfig inside your Gruntfile, or you can r…
$ grunt link-cycler --root=archive/json --interval=30000 --link=current --verbose --initial=10
Running "link-cycler" task
Cycling through last 3 of 12 children, 1 per 30000ms...
Child 10/12:
Linking archive/json/current to archive/json/2013-09-23_12-28-32
Child 11/12:
Unlinking archive/json/current
Linking archive/json/current to archive/json/2013-09-23_12-58-32
Child 12/12:
Unlinking archive/json/current
Linking archive/json/current to archive/json/2013-09-23_13-28-32
Reached last child. Exiting.
Done, without errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment