Dear list, I am syncing files with rsync .... surprise surprise ... Rsync claims files to be uptudate, but they are not ...>From the log:export/opt/bup/status/1 is uptodate export/opt/bup/status/2 is uptodate . . Source directory (locally on server): -rw-r--r-- 1 root root 28 2008-03-01 22:44 1 -rw-r--r-- 1 root root 28 2008-03-01 22:37 2 . . Destination directory (nfs share): -rw-r--r-- 1 root root 28 2008-02-29 22:45 1 -rw-r--r-- 1 root root 28 2008-02-29 22:42 2 . . This files are textfiles containing a date (date >> 1) I did try to get around this with the --checksum option but no success. I discovered this because the files are used for nagios checks. Its just a rsync to a mounted nfs share, so no rsync server. Running the script by cron from cron.daily this "phenomenon" happens. Running the script in the shell by root seams to work ervery time. Have somebody senn this? I hope somebody has a hint how to solve this. Regards Carsten ================================================================================= Debian sarge system: rsync version 2.6.9 protocol version 29 Linux server 2.4.27-2-686-smp #1 SMP Wed Aug 17 10:05:21 UTC 2005 i686 GNU/Linux Here is the interesting part of the script: # options to pass to rsync OPTIONS1="--force --ignore-errors --delete --delete-excluded --checksum -aRvv" OPTIONS2="--force --ignore-errors --delete --delete-excluded --checksum -aRvv" export PATH=$PATH:/bin:/usr/bin:/usr/local/bin # our actual rsyncing function a_rsync() { for BACKUPDIR in $BUPDIR1; do rsync $OPTIONS1 $BACKUPDIR $ARCHIVE1/$CURRENT1 >> /var/log/cronscripts/2serverbup.log 2>&1 done } b_rsync() { for BACKUPDIR in $BUPDIR2; do rsync $OPTIONS2 $BACKUPDIR $ARCHIVE2/$CURRENT2 >> /var/log/cronscripts/2serverbup.log 2>&1 done } . . . a_rsync && b_rsync && date > /tmp/backup set run in cron: BASH=/bin/sh BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i386-pc-linux-gnu") BASH_VERSION='2.05b.0(1)-release' DIRSTACK=() EUID=0 GROUPS=() HOME=/root HOSTNAME=server HOSTTYPE=i386 IFS=' ' LANG=de_DE@euro LANGUAGE=de_DE:de:en_GB:en LOGNAME=root MACHTYPE=i386-pc-linux-gnu OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PIPESTATUS=([0]="0") POSIXLY_CORRECT=y PPID=25970 PS4='+ ' PWD=/root SHELL=/bin/sh SHELLOPTS=braceexpand:hashall:interactive-comments:posix SHLVL=2 TERM=dumb UID=0 set as root: BASH=/bin/bash BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i386-pc-linux-gnu") BASH_VERSION='2.05b.0(1)-release' COLUMNS=143 DIRSTACK=() EUID=0 GROUPS=() HISTFILE=/root/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=/root HOSTNAME=server HOSTTYPE=i386 IFS=$' \t\n' LANG=de_DE@euro LANGUAGE=de_DE:de:en_GB:en LINES=43 LOGNAME=root LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' LS_OPTIONS=--color=auto MACHTYPE=i386-pc-linux-gnu MAIL=/var/mail/root MAILCHECK=60 OLDPWD=/export/opt OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 PIPESTATUS=([0]="0") PPID=23385 PS1='\h:\w\$ ' PS2='> ' PS4='+ ' PWD=/etc/cron.daily SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor SHLVL=1 SSH_CLIENT='10.20.1.63 57566 22' SSH_CONNECTION='10.20.1.63 57566 10.20.2.11 22' SSH_TTY=/dev/pts/0 TERM=xterm UID=0 USER=root _=set -------------- next part -------------- HTML attachment scrubbed and removed
On Sun, 2008-03-02 at 17:43 +0100, Carsten.Wendland@sigeurope.com wrote:> Rsync claims files to be uptudate, but they are not ... > > From the log: > export/opt/bup/status/1 is uptodate > export/opt/bup/status/2 is uptodate > . > . > > > Source directory (locally on server): > -rw-r--r-- 1 root root 28 2008-03-01 22:44 1 > -rw-r--r-- 1 root root 28 2008-03-01 22:37 2 > . > . > > Destination directory (nfs share): > -rw-r--r-- 1 root root 28 2008-02-29 22:45 1 > -rw-r--r-- 1 root root 28 2008-02-29 22:42 2 > . > .Weird. Those files clearly differ in mtime, so rsync should be transferring them. Perhaps the source and destination being passed to rsync are not what they are supposed to be. Please put "set -x" and a "pwd" call at the beginning of the script, run the cron job, and post the current directory and actual rsync command line that result. Also, what are the absolute paths of the directories that you listed above? If this information does not reveal the problem, the next step would be to strace rsync ("strace -f -o /tmp/rsync.strace rsync ...") to see what files it is accessing and what mtimes it is seeing. Matt