General :: Change A Line In A Rsync Script And Send The File Changed?

Nov 19, 2010

I'm configuring an rsync between 2 machines, A_Server --> B_Server, using the following script:

Code:
#!/bin/bash
#
# Script de backup a trav�s de Rsync desde RMP-1 hasta RMP-2.
#

[Code]....

The Rsyn is working OK. What i need is to change one of the lines of the /tmp/prueba.txt before sending it to the remote machine (obviously not changing the file in the local machine), i mean, send prueba.txt to the remote machine deleting one line and adding another one...how can i do this?

View 1 Replies


ADVERTISEMENT

Server :: Change A Line In A File And Send To A Remote Machine With Rsync?

Nov 20, 2010

I'm configuring an rsync between 2 machines, A_Server --> B_Server, using the following script:Quote:

#!/bin/bash
#
# Script de backup a trav�s de Rsync desde RMP-1 hasta RMP-2.

[code]....

View 6 Replies View Related

General :: Send A File From One Computer To Another By Command Line?

Jan 27, 2010

I've got a Debian Squeeze computer on which the graphics have packed up, but the terminal in single user mode work perfectly fine.

There are a few files on this Debian computer that I want to transfer off, to a networked computer, but I have no idea how to do this.

The destination computer is a freshly re-setup Mandriva install, without (as yet) samba. I don't think it's necessary though. The Mandriva install works fine, has graphics, etc, but can't see the Debian Squeeze computer on the network, possibly because it's in single user mode, thus prompting the problem of how to transfer the files, using only a command line.

View 6 Replies View Related

General :: How To Add Such Filter To Rsync Command Line

Oct 27, 2010

I'm trying to understand rsync filters .. but it isn't goig to well.I want to rsync only files with a specific extension (.gz.des3). Could someone please tell me how to add such filter to the rsync commandline (not a seperate filter filer).

View 2 Replies View Related

General :: Send The Output Of Send Command To A File?

Jan 20, 2011

in the middle of script, i need to send the output of (send command on line 8) to a file

#!/usr/bin/expect
spawn telnet 172.20.64.133
expect "ENTER USERNAM <"

[cod]....

i treid the below on line 8 :

1- send "show command;

" > logfile.txt : gives an error extra character after the "

2- logsave logfile.txt 'send "show command;

" ': error invalid command

3- i simply tried to send the output of the whole script to file logsave /home/logfile ./script : seems that logsave work under root only

4- ./script > logfile : the problem with this is that the output of echo or (read "enter your id") command will not be displayed on the screen (actually nothing will be displayed, i have to open the log file to see the output). is there any way to save the log of the "send" ? or to save the log of the complete script without hiding the output on the screen?

View 2 Replies View Related

OpenSUSE :: Rsync Copying All Files Instead Of Just What's Changed

Jan 11, 2011

During my backups I'm finding that rsync is copying all files, instead of just what's changed.

I'm rsyncing between 2 USB external hard drives. One hard drive is FAT32 and one is NTFS. I've examined some of the files and believe that the difference is that there's a 1-second modtime difference developing in some of the files somehow.

Here's an example. These duplicity files were synced from /media/BACKUPHD (the NTFS drive) to /media/VIDEOHD (the FAT32 drive) only a few hours ago this morning. They have not been touched or changed since then, but that 1-second difference in their time stamps has appeared:

Code:
tim@localhost:~> stat /media/BACKUPHD/backups/duplicity/duplicity-full.20110107T145955Z.vol10.difftar.gpg File: `/media/BACKUPHD/backups/duplicity/duplicity-full.20110107T145955Z.vol10.difftar.gpg'

[Code]....

View 8 Replies View Related

Ubuntu Servers :: Rsync - Backup Only Changed Blocks?

Aug 10, 2010

I'm going to make a nightly backup copy from one server to another, using rsync. If I have a sufficiently large file, say 4+ GB or so, I'm not interested in copying the whole file if only a small change has been made. Can rsync detect small changes on block level and backup only those if needed?

View 2 Replies View Related

CentOS 5 :: RSYNC: Listing Files Added & Changed?

Oct 21, 2010

I'm using rsync to create a mirror of the data files on our main server every day. I've looked at the man page, and can't see it; can I get a listing of the files that have been changed on or added to the mirror when it's completed? Can it just log what it's doing to a file?

View 1 Replies View Related

CentOS 5 Hardware :: Rsync - Changed Blocks Or Files?

Sep 9, 2011

how rsync will handle disk images. Will rsync copy only the changed blocks of a vhd or a lun? This is what I've been told, but wouldn't this require overlaying a filesystem on the vhd? How would rsync handle copying a 500GB lun?

View 1 Replies View Related

General :: Send Email From Command Line?

Mar 2, 2011

I'm looking for an easy way to send basic emails for the command line. I have tried configuring sendmail and mailx, but I have yet been able to receive a test email at my remote address. I have read through a fair amount of "how to" on this but I am a little confused and obviously not doing something right. My sendmail.mc file is as follows

Code:
divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl

When I try to send a test mail via

[Code]....

View 14 Replies View Related

Programming :: Shell Script To Copy Newly Changed Files With Rsync?

Apr 20, 2010

I've got quite a decent rsync script setup, however I'd like to invoke it whenever there's change to a file. My initial idea was to use find, however this has two major flaws - the first being my particular unix veriant cant understand -print0 which means this doesn't work, the second is that I'm not 100% sure how to put variables into quotation marks so ls can understand the target:

Code:

for i in `find /shares/ -mtime -1 -print`; do ls -ltr $i;done

View 14 Replies View Related

General :: Failing To Send Mail From Command Line?

Mar 16, 2010

I am using Ubuntu 9.10 and when I tried to send mail from the command line I get: /usr/lib/sendmail: Permission denied. any takers on this.

View 6 Replies View Related

General :: Send Gpg Encrypted Mail Automatically From The Command Line?

Sep 14, 2010

How can I send gpg encrypted mail automatically from the linux command line?

I'm a little stumped on this one, I've tried using mutt but it doesn't encrypt mail unless it's used interactively.

Does anyone know if you can use the build in mail command to do this some how?

View 1 Replies View Related

General :: Send Email With Attachment By Postfix From Command-line?

Dec 11, 2010

I've just setup a new Ubuntu 10.04 LTS server on linode for myself. Followed an excellent instruction at: here to finish the installation of some basic stuff including postfix.

I am trying to figure out a way to send an email to my gmail address with an attachment, but cannot find how. Already confirmed that email can reach my gmail account.

In the end I have to use mutt to send the email with attachments, probably SendEmails will also do well, but I am wondering how to do the same thing in postfix from command-line?

View 3 Replies View Related

Ubuntu :: Change File Property Using Command Line?

Jan 16, 2011

i want to know how to change file property using linux command line?

View 3 Replies View Related

General :: Scripting - Feed An Input File Into An If Statement Line-by-line

Dec 23, 2009

I am trying to write a script that takes an input file ($FileName) and an intermediate file ($FileName.info) and removes lines from $FileName if the value in $2 of $FileName.info is <75.

I can't figure out how to feed only one line of the .info file to the if statement at a time so that it will perceive it as an integer instead of a list.

The error I am getting now is ./script.sh: line 6: [: : integer expression expected

Sample input $FileName

Code:

Code:

Code:

Script so far:

Code:

View 10 Replies View Related

General :: Parse A File And Print Each Line That Ends With Matching Pattern (if The Next Line Is Blank)

Aug 2, 2010

I've written a script to parse a file and print each line that ends with matching pattern, if the next line is blank. The pattern lines are the result of md5sum $i|sed 's/path///g' so that only md5 and filename appear. Here's what I'm using.

Quote:
for fline in `sed -n '/.*.ext$/p' file1`
do
if [ "`sed -n -e '/'"$fline"'/ {n; p;}' file1`" == "" ]
then
echo ""$fline" has no info" >>file2
fi
done
[Code]....

View 4 Replies View Related

General :: Command Line Way To View A Line Of A File With Context?

Feb 24, 2011

I'd like show a certain line or lines of a file with context, kind of like a unified diff, on the command line in Linux:

$ (something) -l 154 stuff.py
150: def foo(bar):
151: """

[code]....

View 5 Replies View Related

General :: Appending To The Current Line In A File Instead Of Creating A New Line?

Apr 1, 2011

I am combining data from a couple different input files and creating an output file in a specific format. I notice that if I use the >> operator, information gets appended to a new line in my output file. This is useful, but if I'd like to append onto the CURRENT line, is there an easy way to do this? I've been googling around and see lots of complicated answers, nothing that suggests to me an easy way to do this. For example, if my output file looks like this:

b1a:] cat test
hello my name is
b1a:]

and I'd simply like to append "Bob", how can I do it? If I use

b1a:] echo Bob >> test
b1a:] cat test
b1a:] hello my name is
Bob
b1a:]

So what I would prefer is some command that would create the result:

hello my name is Bob

View 14 Replies View Related

General :: How To Monitor Changed File

Jul 3, 2010

How do I monitor which files have been changed after, say, I run the passwd command? (I know, depending on the options used, it changes /etc/shadow and/or /etc/passwd). But I would like to if there is any clever ways of monitoring this. This is how I do it which is a bit crude, and I have to know which directory to monitor. Before running the command, I run

Code:

for i in $(ls -A) do; md5sum $i >> /tmp/before; done

And after running the command, I run

Code:

for i in $(ls -A) do; md5sum $i >> /tmp/after; done

Then I do a diff to see if any file has been changed

Code:

diff /tmp/{before,after}

View 1 Replies View Related

Programming :: Change A Line In A File Code - Sed Special Characters Bash Script

Jan 26, 2011

I'm having issue when trying to change a line in a file

[Code]....

View 1 Replies View Related

General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies View Related

General :: Tool To Run A Command When File Changed?

Sep 16, 2010

Does anybody know of tool for Linux that can watch a custom subtree of the filesystem for changes, and executes a custom command when a change occurs ? Such a tool would be very useful to quickly setup automatic building or uploading of source files.

View 1 Replies View Related

General :: Check If A Website File Has Changed?

Jan 18, 2010

I have a site that I login to to check updates. It does not have RSS because users need to authenticate themselves before getting access to the page. Is there a way to write a script that can login to the page and check whether the HTML has changed and then send me an email?

View 13 Replies View Related

General :: Rsync - Password-file Not Working ?

May 23, 2011

I made a shell backup script that uses Rsync and I am trying to get rid of the password prompt because it will use a CRON to run. I have set my variable in my shell script at:

PASSWORD_FILE=rsync_password

And the password in that file only takes up 1 line.

However when I run (ignore $DESTINATION)

rsync -aRvz tmp $DESTINATION --password-file=$PASSWORD_FILE

It still gives me the prompt. How can I accomplish this? I cannot allow a prompt and I do not want to have to use keys.

View 1 Replies View Related

General :: Rsync Command - For File Backup ?

Mar 23, 2011

I'm going to be using this command to back up my files:

Should I change anything or is it ok?

View 4 Replies View Related

Slackware :: Should Last Line In SlackBuild Be Changed .tgz To .txz

Jun 23, 2010

Running Slackware64-13.1; installed the SlackBuild Blender and I changed the last line in SlackBuild script to .txz everything seems fine. Now I'm looking at FlashPlayer SlackBuild, noticed the last line is .tgz? Just want to make sure I am supposed to be changing the last script line .tgz to .txz?

View 5 Replies View Related

General :: Resume Transferof A Single File By Rsync?

Sep 25, 2010

I want to copy a big file from my harddrive to a removable drive by rsync. For some other reason, the operation cannot complete in a single run. So I am trying to figure out how to use rsync to resume file copying from where was left last time.

I have tried use the option --partial or --inplace, but together with --progress, I found rsync with --partial or --inplace actually starts from the beginning instead of from what was left last time. Mannually early stopping rsync and checking the size of the received file also confirm what I found.

But with --append, rsync starts from what was left last time. I am confused as I saw on the manpage --partial, --inplace or --append seem to relate to resuming copying from what was left last time. Is someone able to explain their difference? Why --partial or --inplace do not work for resuming copying? Is it true that for resuming copying, rsync has to work with option --append?

Also if a partial file was left by mv or cp not by rsync, will rsync --append correctly resume the file copying?

View 1 Replies View Related

General :: Rsync Error - Read-only File System - 30

Jan 4, 2011

I regularly rsync directories to an external usb drive. Recently I've started getting errors which look:
blah blah:Read-only file system (30)

The external usb drive has two partitions (ext3 and fat32) and I rsync to the ext3 one. The rsync command is
rsync -ahi --delete /home/mike/some_dir /media/usb_drive

People have reported this error with faulty usb cables but everything was working fine until recently so it seem unlikely a usb cable would suddenly wear off.

View 6 Replies View Related

General :: RSYNC Error .tar.gz 14gb File / Transfer Huge 14 Gb File Over Network,vpn,wan Transfer?

Mar 10, 2010

i am trying to transfer a file from my live linux machine to remote linux machine it is a mail server and single .tar.gz file include all data. but during transfer it stop working. how can i work and trouble shooot the matter. is there any better way then this to transfer huge 14 gb file over network,vpn,wan transfer. the speed is 1mbps,rest of the file it copy it.

rsync -avz --stats bkup_1.tar.gz root@10.1.1.22:/var/opt/bkup

[root@sa1 logs_os_backup]# less remote.log
Wed Mar 10 09:12:01 AST 2010
building file list ... done
bkup_1.tar.gz
deflate on token returned 0 (87164 bytes left)
rsync error: error in rsync protocol data stream (code 12) at token.c(274)
building file list ... done
code....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved