Hi all,
I tried to find it but i couldn't. Is it really true that you can't get a mail alert for rsync jobs?
THANKS!
Casper
Hi all,
I tried to find it but i couldn't. Is it really true that you can't get a mail alert for rsync jobs?
THANKS!
Casper
If you set the 'Send output' checkbox you'll get an email when the job is done.
Hi and sorry for my late reply..
I have set the "send output" checkbox but i don't get any email still..
im trying to find a timestamp for when the job was finished at what date and time..
can any of you help?
I'm looking for this too.
Either a way to log start and end time for these jobs, or actually get the email alert?
I did make some progress on this. I added lines 4,5 and 9,10
Fri Feb 24 18:08:17 root@omv-pw vi /usr/share/openmediavault/mkconf/rsync
...
-o "trap cleanup 0 1 2 5 15" -n \
-o "NOW=\$(date +\"%F %T\")" -n \
-o "echo \"\$NOW BEGIN: ${srcuri}\" >> /var/log/rsync-OMV.log" -n\
-o "touch ${runfile}" -n \
...
-o " ${srcuriarg} ${desturiarg} & wait \$!" -n\
-o "NOW=\$(date +\"%F %T\")" -n \
-o "echo \"\$NOW END: ${srcuri}\" >> /var/log/rsync-OMV.log" -n\
${OMV_CONFIG_FILE} | xmlstarlet unesc > ${filename}
Display More
Which creates an appended log /var/log/rsync-OMV.log
What I'd really like to do is to be able to reference the rsync job's destination or comment, so that a job can append to a job-specific log file:
e.g. /var/log/rsync-Installs.log
Is there some reference/variable that I can read from the job to get this Destination or Comment value? e.g.:
In fact, I would like to know how to retrieve the Comment value for the job, and I would simply make the comment the filename of the log file, e.g.: /var/log/rsync-Installs.log. Reviewing this code:
I was wondering if there was a similar command to get the Comment value. I had guessed it to be like:
but that didn't work.
Figured it out
I modified /usr/share/openmediavault/mkconf/rsync:
log=$(omv_config_get "//services/rsync/jobs/job[uuid='${uuid}']/comment")
if [ -z "$log" ]; then log="/var/log/rsynclog.log" ; fi
if [ $(wc -l $log | cut -d ' ' -f 1) -gt 99 ]; then sed -i -e "1,345 d" $log; fi
...
-o "NOW=\$(date +\"%F %T\")" -n \
-o "echo \"=======================================================================================\" >> ${log}" -n\
-o "echo \"\$NOW BEGIN: ${srcuri}\" >> ${log}" -n\
...
-o "NOW=\$(date +\"%F %T\")" -n \
-o "echo \"\$NOW END: ${desturi}\" >> ${log}" -n\
Display More
Don’t have an account yet? Register yourself now and be a part of our community!