RsyncProject / rsync

An open source utility that provides fast incremental file transfer. It also has useful features for backup and restore operations among many other use cases.
https://rsync.samba.org
Other
2.88k stars 337 forks source link

error rsync code 23 #653

Open aragon5956 opened 2 weeks ago

aragon5956 commented 2 weeks ago

hello, I downloaded rsync from apt , and I got a error 23: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main. c(1338) [sender=3.2.7]is this related to the remote repo owner being www-data, and I connect to the server with a different user? , if so how to avoid having the error

regards

aragon5956 commented 2 weeks ago

I found the case by myself, yes it is related , but I don’t see a way to solve the pb linked to the permission on the remote web server.

my bash script is :

#!/bin/bash

# Définir le mot de passe pour sshpass
PASSWORD="AAA"

# Définir l'utilisateur et l'hôte pour SSH
SSH_USER="ale"
SSH_HOST="x.x.x.x"

# Définir le chemin du projet distant
REMOTE_PATH="/var/www/webProject"

# Nettoyer le cache local
php bin/console cache:clear

# Synchroniser les fichiers avec rsync
sshpass -p "$PASSWORD" rsync -avz --copy-links\
    --exclude=".git/" \
    --exclude="connection.sh" \
    --exclude="deploy.sh" \
    --exclude=".env.local" \
    --exclude="download.sh" \
    --exclude="node_modules/" \
    --exclude="vendor/" \
    ./ "$SSH_USER@$SSH_HOST:$REMOTE_PATH/"

# Exécuter la commande de nettoyage de cache sur le serveur distant
sshpass -p "$PASSWORD" ssh -t "$SSH_USER@$SSH_HOST" "cd $REMOTE_PATH && php bin/console cache:clear --env=prod --no-debug"

# Définir l'utilisateur HTTP (normalement www-data pour Nginx)
#HTTPDUSER="www-data"

# Appliquer les ACL localement (notez que cela nécessite sudo, donc le mot de passe sera demandé)
#sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var

#echo "Déploiement terminé avec succès!"

could you help me ?