Sponsored Content
Top Forums Shell Programming and Scripting Help with changing rsync script Post 302499275 by pnara2 on Wednesday 23rd of February 2011 10:06:03 PM
Old 02-23-2011
Here is what I tried

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
Code:
#!/bin/ksh
success=0
failure=0
for i in  $(cat /tmp/OUTPUT/rsync-success-outputfile)
do
if [ $i == RSYNC of content store completed successfully ]; #name which you want to find from the given file
then
success=`expr $success + 1`
fi
done
for i in  $(cat /tmp/OUTPUT/rsync-failure-outputfile)
do
if [ $i == RSYNC of content store failed ]; #name which you want to find from the given file
then
failure=`expr $failure + 1`
fi
done
echo $success
echo $failure


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
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync script in cron from stepping on itself

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)
Discussion started by: sunsysadm2003
3 Replies

2. Shell Programming and Scripting

rsync script ...

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)
Discussion started by: abalakrishnan
2 Replies

3. OS X (Apple)

rsync is changing permissions

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)
Discussion started by: rlinsurf
8 Replies

4. UNIX for Advanced & Expert Users

Rsync Script Modification

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)
Discussion started by: treds
0 Replies

5. Shell Programming and Scripting

Help with rsync script

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)
Discussion started by: Noura-83
1 Replies

6. Shell Programming and Scripting

Help with rsync script

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)
Discussion started by: Noura-83
4 Replies

7. Shell Programming and Scripting

Rsync script and backup problems.

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)
Discussion started by: boytruc
7 Replies

8. Shell Programming and Scripting

Cp script like rsync

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)
Discussion started by: bigal.nz
2 Replies

9. Shell Programming and Scripting

Help with rsync file restore script

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)
Discussion started by: jdavis_33
1 Replies

10. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

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)
Discussion started by: mohtashims
2 Replies
rsync_selinux(8)					rsync Selinux Policy documentation					  rsync_selinux(8)

NAME
rsync_selinux - Security Enhanced Linux Policy for the rsync daemon DESCRIPTION
Security-Enhanced Linux secures the rsync server via flexible mandatory access control. FILE_CONTEXTS SELinux requires files to have an extended attribute to define the file type. Policy governs the access daemons have to these files. If you want to share files using the rsync daemon, you must label the files and directories public_content_t. So if you created a special directory /var/rsync, you would need to label the directory with the chcon tool. chcon -t public_content_t /var/rsync To make this change permanent (survive a relabel), use the semanage command to add the change to file context configuration: semanage fcontext -a -t public_content_t "/var/rsync(/.*)?" This command adds the following entry to /etc/selinux/POLICYTYPE/contexts/files/file_contexts.local: /var/rsync(/.*)? system_u:object_r:publix_content_t:s0 Run the restorecon command to apply the changes: restorecon -R -v /var/rsync/ SHARING FILES
If you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public_content_t and pub- lic_content_rw_t. These context allow any of the above domains to read the content. If you want a particular domain to write to the pub- lic_content_rw_t domain, you must set the appropriate boolean. allow_DOMAIN_anon_write. So for rsync you would execute: setsebool -P allow_rsync_anon_write=1 BOOLEANS
system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was written by Dan Walsh <dwalsh@redhat.com>. SEE ALSO
selinux(8), rsync(1), chcon(1), setsebool(8), semanage(8) dwalsh@redhat.com 17 Jan 2005 rsync_selinux(8)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy