chucha
1
Is there a simple shell command/script that
supports excluding certain files/folders from being copied?
There is
cp -R /opt/lampp/htdocs/ockham/ /home/vlm/BACKUP/OCKHAM/ockham_$(date "+%m_%d_%y_%H-%M")
if [ $? == 0 ]; then echo 'Copy PC- OK !!!';
else
echo 'No, Error.';
fi
There exists /ockham/picture with jpg-files.
They, katalog picture must not been copied.
How can I do it?
Thank you.
1 Like
dalto
2
It is really easy with rsync.
rsync --exclude='something-to-exclude' /path/to/source /path/to/destination
4 Likes
rsync = the one indeed…
1 Like
pebcak
6
Was it this command, the solution ?
2 Likes
i correct this… and not a command only my comment
2 Likes
chucha
8
Text below :
rsync -ar --exclude 'assets/pictures/' /opt/lampp/htdocs/ockham/ /home/vlm/BACKUP/OCKHAM/ockham_$(date "+%m_%d_%y_%H-%M")
if [ $? == 0 ]; then echo 'Copy PC- OK !!!';
else
echo 'No, Error.';
fi
rsync -ar --exclude 'assets/pictures/' /opt/lampp/htdocs/ockham/ /run/media/vlm/INTENSO/OCKHAM/ockham_$(date "+%m_%d_%y_%H-%M")
if [ $? == 0 ]; then echo 'Copy Stick- OK !!!';
else
echo 'No, Error.';
fi
And once again - THANKS !!!
system
Closed
9
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.