update.c
update.c · 549 B
From the archive autobackup.tar.gz
Download the archive « Back to the archive contents
/*
Place this somewhere in the update routine, it should be called at
least once an hour. At the current setting it'll create a backup once
a week.
No restrictions on use. 12/19/2008
*/
{
static int lasthour;
struct tm currtime;
time_t temptime;
temptime = (time_t) time(NULL);
currtime = *localtime(&temptime);
if (lasthour != currtime.tm_hour)
{
if (currtime.tm_wday == 0 && currtime.tm_hour == 0)
{
log_printf("Backing up files.");
system("cd ..;./autobackup&");
}
lasthour = currtime.tm_hour;
}
}