Sponsored Content
Top Forums Shell Programming and Scripting [BASH] rsync - error on destination Post 302405822 by PaganoM on Saturday 20th of March 2010 06:59:33 AM
Old 03-20-2010
[BASH] rsync - error on destination

Hi everyone, and thanks to all for your assistance.
I have a problem with the rsync command. I want to make a backup of a "source" directory in a "destination" directory.

I want to specify:
  • "absolute path of destination" (identified by a ~): ~/Destination
  • or a "relative path of destination" (without ~): Destination
The first one (absolute) will make the Backup in: ~/Destination;
The second one (relative) will make the Backup in: $PATH/Destination;

The code I used is:
Code:
rsync -ptrb --delete --backup-dir=$2-xyz --suffix="" $source $destination

I have a problem when I use an "absolute path" in $destination: my rsync will try to backup in $PATH/Destination (and not in $Destination).

How can I remedy the concatenation of $destination after $PATH ???
Thank you so much ... I hope you'll help me ...

Last edited by PaganoM; 03-20-2010 at 08:04 AM.. Reason: I wrote a wrong code ...
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

rsync: taking advantage of files in different directory other than destination

Dear Folks, I have to backup pgsql database dump everynight on a routine. The database dump actually contains sql(text) statements. The actual size of the database dump is aroung 800 MB. Between two days backup, only few lines of statements are modified/added/deleted. I dont want to do... (1 Reply)
Discussion started by: rssrik
1 Replies

2. Shell Programming and Scripting

rsync bash php

Hello, I have a bash script update.sh that contains rsync --delete -avz -e ssh ${files} root@64.XX.XX.XX:/websites/red/ when I use that script ./update.sh as root, it works like a charm as I set up the private/public key properly. When run from a php script through the apache webserver <?php... (10 Replies)
Discussion started by: JCR
10 Replies

3. Shell Programming and Scripting

Bash script error: missing destination file name operand.

Ok, i've been messing around in debian the past few days, setting up programs like subversion, mysql and logrotate. The purpose of this script is to use subversion to backup the binary logs. It runs in the cron every 2 hours or so (although I can't get my script to run properly atm, which is why... (1 Reply)
Discussion started by: cganly
1 Replies

4. Shell Programming and Scripting

Bash script to back up with rsync

I'm trying to write a script to back up with rsync, the script I am posting below: nomServer="shiva horus isis" dirshiva="/etc /faturamento" shivaListExc="/usr/local/bin/shivaListExclRsync" dumpDir="$dumpFile/Shiva" dateBkp=`date +%A` for nServer in ${nomServer} do ... (3 Replies)
Discussion started by: ajmoreti
3 Replies

5. Shell Programming and Scripting

Rsync not deleting files on destination

I've got a rsync script that backups file from disk1 to disk3. This works great however if there are extra files on disk3 they do not get deleted by the sync. I'm syncing all folders from F-J rsync --progress -v --delete --delete-excluded -av --recursive /home/disk1/Files/*... (0 Replies)
Discussion started by: gmccarthy
0 Replies

6. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh usa0300uz1247.apps.mc.xerox.com... (0 Replies)
Discussion started by: lovelysethii
0 Replies

7. UNIX for Dummies Questions & Answers

Rsync not deleting destination files/folders

Hi All, I want delete all files from destination folder. I am trying below commands rsync -avFF --delete-after /home/vizion/source/ /home/vizion/destination/ I need to be delete all file/fodders from destination Any body have idea ? Please correct me. (3 Replies)
Discussion started by: Chenchireddy
3 Replies

8. Shell Programming and Scripting

Email Notifications on Cron Bash Error Only cp mv rsync

Wondering if anyone can point me to an example of how to setup a bash script that executes cp mv and rsync commands and only sends an email if there were errors with any of those commands and what the errors are. In addition it should email if the cron event to execute the script fails, or in... (1 Reply)
Discussion started by: consultant
1 Replies

9. UNIX for Advanced & Expert Users

Rsync - delete extra files in Destination without synchronising directories

I have a script that synchronises a directory to a DR server, but to improve the time, I actually use rsync to transfer files * in one batch and also * in another batch - both batches run from the same script and run in the background. My problem is that there isn't much space on the... (1 Reply)
Discussion started by: Catullus
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
INSTALLIT(1)						      General Commands Manual						      INSTALLIT(1)

NAME
installit - file/directory installation tool SYNOPSIS
installit [ -o owner ] [ -g group ] [ -O owner ] [ -G group ] [ -m mode ] [ -b backup ] [ -s ] [ -t ] source destination DESCRIPTION
Installit puts a copy of source into the specified destination. If source is a period, then destination is taken to be the name of a directory that should be created. Otherwise, source is taken to name an existing file and destination may be either a file or directory; it is interpreted according to the same rules as cp(1). Installit uses no special privileges to copy files from one place to another. OPTIONS
-b If destination names a pre-existing file, it will be removed before the copy is done. To make a backup copy, use the ``-b'' flag; the existing file will be renamed to have the specified extension. If source and destination are the same string, or if the two files are identical, then no copying is done, and only the ``-o'', ``-g'', ``-m'', and ``-s'' flags (see below) are processed. In this case, the modification time on the destination will be updated using touch(1). -n Do not update the modification time on the destination. -o -g -m Once the destination has been created, it is possible to set the owner, group, and mode that it should have. This is done by using the ``-o'', ``-g'', and ``-m'' flags, respectively. -O -G The ``-O'' and ``-G'' flags set the owner and group only if installit is being run by root, as determined by whoami(1). -s To strip(1) an installed executable, use the ``-s'' flag. BUGS AND LIMITATIONS
Flags cannot be combined. The chown(8) command must exist in either the /etc or /usr/etc directory or the user's PATH. The whoami command must exist in the /usr/ucb directory or the user's PATH. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.9, dated 1996/10/29. INSTALLIT(1)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy