This script is pretty simple and self explanatory. All it does is that it copies the content from source server to destination server. The cron is set up in such a way that this rsync script runs very frequently! So result is that you get hundreds of emails stating "Prad Test script - RSYNC of source content completed successfully".
Here is what I am planning to do:
1. I should get only 1 email at end of day instead of my mail box getting flooded with rsync success or failure messages.
2. In that email report, I should be able to see the number of times rsync of source content was "success" and also the number of times rsync of source content "failed"
My approach:
1. I am trying to send the results to a file instead of email
2. Count the keywords "completed" and "failed" from that file.
Drawback:
The file will just grow in size and I need to come up with a way to remove the contents of the file after certain days.
Note: I am yet to research this step!
Please let me know if my approach makes sense?? If not, please suggest me some alternatives!
I think that you should send rsync output into a temporary file ,and cron another script to check the temporary file , mail the result to your box,then empty the file
I sent the success and failure messages to 2 different files- rsync-success-outputfile and rsync-failure-outputfile.
Wrote an other script called count.sh
Other than counting, I want to display a report of some sort stating rsync failed 4 times and they were at 1PM, 2PM, 3PM, 4PM ....whatever.
The sole aim is to know at what time rsync failed. I really do not bother about the time frame where rsync was a success. All, I need is to know how many times rsync error occured and at what time specifically?
Any suggestion?
BTW, thanks for your response. It helped me a lot.
Last edited by Franklin52; 02-24-2011 at 03:31 AM..
Reason: Please use code tags
I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location
I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Hello Friends,
I am trying to create an rsync file restore script. I will post want I have below and explain the problem I am having.
#!/bin/bash
#
# Partial Rsync File Restore Script
#
#
clear
echo
# Shell loads into /raid0/data/backup/bin/
cd .. # I cd to the backup... (1 Reply)
Hi Folks,
I have a NAS running busybox with a ARM processor.
Several PC's backup full weekly and several daily incrementals to the NAS.
The NAS has two USB attached disks, which are swapped off site weekly.
The problem is the built in rsync only transfers at 2Mb/s to the external USB... (2 Replies)
Hello everybody
I'm triing since few days to do this. So sorry if my question looks stupide, but i've tried.
I have to get picture from a folder (who is updated automaticly and with subfolder) with theirs extensions (i'm ok on that) and this files have to me copied in a folder where a website... (7 Replies)
Good day all,
I need your help in editing a rsync script that I am trying to write and using ksh shell.
I want to add multiple patterns --include and --exclude options with variable inputs called SID. I have created two files and named them N1 and N2 and created subfiles in each one
In... (4 Replies)
Good day all,
I need your help in editing a rsync script that I am trying to write and using ksh shell.
I want to add multiple patterns --include and --exclude options with variable inputs called SID. I have created two files and named them N1 and N2 and created subfiles in each one
In N1... (1 Reply)
Hi
I have a rsync that runs from a remote location to our central data store.
The sync generates a log locally not in the central location.
I would like to modify the rsync to add the following
The log, instead of filing locally it gets sent to a area on the central data store
once the syncs... (0 Replies)
I have the following command. This is meant to download all files from my server to the Downloads folder of my startup drive:
/usr/local/bin/rsync -avve ssh --numeric-ids --delete --ignore-errors -R grndlvl@myserver.com:/usr/home/./grndlvl grndlvl@myserver.com:/usr/home/./grndlvl/mail_boxes/... (8 Replies)
Hi all,
I am a newbie in unix and i want a script which should sync files between two servers like rsync.
The condition is that.
after rsync command is completed it should also list me how many files has been changed during the rsync execution.
if the rsync execution has failed , then... (2 Replies)
I have the following rsync script that I use for syncing MySQL files from one server to another. I run the script at 20 minutes past every second hour in cron. I want to make sure that the script completes in it's entirety before it is set to kick off again. For example, when the script starts at... (3 Replies)