Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

rsync s'obstine

1 réponse
Avatar
Franssoa
Bonjour,

Je sauvegarde quotidiennement les données de mon serveur linux vers un
poste Windows de mon lan par rsync et un script que j'ai trouvé sur le
net (voir à la fin du message).
Cela me donne 1 sauvegarde totale par semaine, et 1 incrémentale par
jour, j'efface à la main les backups qui s'accumulent quand le disque
cible est plein.

Hors, je m'aperçoit qu'un grand nombre de fichiers non modifiés sont
systématiquement sauvegardés tous les jours. Je ne sais pas si c'est le
fait de sauvegarder sur un pc windows, et donc sans pouvoir garder les
attributs group/owner/rwx ?

Est-ce que quelqu'un a déjà expérimenté ce problème ?

Franssoa

--
#!/bin/sh
umount /mnt/backup
mount -t smbfs -o credentials=/home/outils/.credentials
//philippe/backup /mnt/backup/

#########################################################
# Script to do incremental rsync backups
# Adapted from script found on the rsync.samba.org
# Brian Hone 3/24/2002
# This script is freely distributed under the GPL
#########################################################

###################################
# mail address for status updates
# - This is used to email you a status report
###################################
MAILADDR=root@linux2.local

###################################
# HOSTNAME
# - This is also used for reporting
###################################
HOSTNAME=linux2

###################################
# directory to backup
# - This is the path to the directory you want to archive
###################################
#LIST="/home/www /home/commun /etc"
LIST="/home"

###################################
# excludes file - contains one wildcard pattern per line of files to exclude
# - This is a rsync exclude file. See the rsync man page and/or the
# example_exclude_file
###################################
EXCLUDES=/home/outils/backup_exclusions

###################################
# root directory to for backup stuff
###################################
ARCHIVEROOT=/mnt/backup

#########################################
# From here on out, you probably don't #
# want to change anything unless you #
# know what you're doing. #
#########################################

# directory which holds our current datastore
CURRENT=`date +%Y-%U`

# directory which we save incremental changes to
INCREMENTDIR=`date +%Y-%U-%A`

# options to pass to rsync
OPTIONS="--force --ignore-errors --delete --delete-excluded \
--exclude-from=$EXCLUDES --backup
--backup-dir=$ARCHIVEROOT/$INCREMENTDIR -av"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# make sure our backup tree exists
install -d $ARCHIVEROOT/$CURRENT

# our actual rsyncing function
do_rsync()
{
rsync $OPTIONS $BACKUPDIR $ARCHIVEROOT/$CURRENT
}

# our post rsync accounting function
do_accounting()
{
echo "Backup Accounting for Day $INCREMENTDIR on
$HOSTNAME:">/tmp/rsync_script_tmpfile
echo >> /tmp/rsync_script_tmpfile
echo
"################################################">>/tmp/rsync_script_tmpfile
du -s $ARCHIVEROOT/* >> /tmp/rsync_script_tmpfile
Mail $MAILADDR -s $HOSTNAME root < /tmp/rsync_script_tmpfile
rm /tmp/rsync_script_tmpfile
}

# some error handling and/or run our backup and accounting
for BACKUPDIR in $LIST; do
if [ -f $EXCLUDES ]; then
if [ -d $BACKUPDIR ]; then
# now the actual transfer
do_rsync && do_accounting
else
echo "cant find $BACKUPDIR"; exit
fi
else
echo "cant find $EXCLUDES"; exit
fi
done

1 réponse

Avatar
Arol
"Franssoa" a écrit dans le message de news:

[snip]

Vérifie les versions de rsync sur les clients / serveurs.
La 2.6.9 marche, avec les autres version, il y a un problème de
compatibilité.