Skip to content

Instantly share code, notes, and snippets.

@Riateche
Created December 4, 2012 18:44
Show Gist options
  • Save Riateche/4207355 to your computer and use it in GitHub Desktop.
Save Riateche/4207355 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int main() {
FILE * file = popen("/usr/bin/crontab", "w");
const char* command = "* * * * * /bin/true\n";
fwrite(command, 1, strlen(command), file);
pclose(file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment