Hi, Matthieu Bollot wrote on 2009-11-18 14:25:44 +0100 [[BackupPC-users] cronjob if needed]: > I want to send an email after 7 days since the last backup, so I could > setEMailNotifyOldBackupDays to 6.97. > > But what I actually want is to send an e-mail at 12am. So I could make a > cron job : > 00 00 12 * * backuppc /usr/share/backuppc/bin/BackupPC_serverMesg backup > host.domain.tld host.domain.tld backuppc 1
the status e-mails are sent by BackupPC_sendEmail, which is called by BackupPC_nightly, not by BackupPC_dump, so triggering a backup won't result in the e-mail being sent (even if the backup is unsuccessful). If you can arrange for BackupPC_nightly to be run at the time you want the e-mails to be sent, that should take care of what you want to achieve (except that the e-mails are sent *after* pool cleanup, which will be an arbitrary - possibly large - amount of time later). The question is whether that is a good time in your circumstances to run the pool cleanup. Hint: BackupPC nightly is run on the first hour in $Conf{WakeupSchedule}. If the time is inconvenient for pool maintenance, you can probably call BackupPC_sendEmail directly, but that won't prevent it from also being called from BackupPC_nightly, so *some* of the emails will probably be sent from there (for hosts which have become "overdue" between last BackupPC_sendEmail call and BackupPC_nightly run). As for the time, are you talking about midnight (12am, '00 00' in crontab) or noon (12pm, '00 12' in crontab - I suppose you weren't intending to do this only on midnight of the twelfth of each month ('00 00 12' in crontab) as your crontab entry suggests ;-)? > Now, more difficult (that's why I'm sending an email) I want to do both > of them. > after 6days, the next time it is 12am I send an email. > ie : > I backup monday 1st at 5pm, > I receive an email monday 8th at 12am. This suggests you probably mean noon (12pm). > And backup when receiving the email I don't quite understand what you're intending here. Are you intending to script a reaction to overdue backups? Is that possible? If so, wouldn't it be better to make backups succeed when scheduled in the first place (DumpPreUserCmd or PingCmd)? Or do you want to replace BackupPC's scheduling? Or are you talking about manual intervention by the person reading the e-mail? > [...] I will do this in shell but the results of backuppc_servermesg seems > to be perl, isn't it ? Strictly speaking it's a string which happens to parse as one or more Perl assignments (once you remove the "Got reply:") - at least for the 'status' command, that is. It is probably much easier to do anything meaningful with the value in Perl than in a shell script. Regards, Holger ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/