Last active
December 22, 2015 13:48
-
-
Save CaporalDead/6481314 to your computer and use it in GitHub Desktop.
Backup de tous les projets SVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#/scripts/backupSVN.sh | |
jour=$(LANG=C date +%A | tr A-Z a-z) | |
motifsvn="/data/www/*/svn/*" | |
backupdir="/backup" | |
### ##### ### | |
if [ ! -d "$backupdir/$jour" ]; then | |
mkdir "$backupdir/$jour" | |
fi | |
### ##### ### | |
echo " " | |
echo "Backup $jour :" | |
for dir in `ls -1 -d $motifsvn | egrep -v 'index|projects'` | |
do | |
project=`basename $dir` | |
echo " " | |
echo " + Project at $project " | |
if [ -f "$backupdir/$jour/$project.svndump.gz" ]; then | |
echo " > Delete previous backup" | |
rm -rf "$backupdir/$jour/$project.svndump.gz" | |
fi | |
echo " > Creating new backup" | |
svnadmin -q dump $dir > $backupdir/$jour/$project.svndump | |
echo " > Creating new archive from backup" | |
gzip $backupdir/$jour/$project.svndump | |
done | |
echo " " | |
echo "Back $jour done !" | |
echo " " | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@daily /scripts/backupSVN.sh | head -c 1k >> /scripts/logs/backupSVN.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment