forked from Hubbitus/shell.scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepomirror.ant
executable file
·27 lines (20 loc) · 1.02 KB
/
repomirror.ant
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
LOCAL_REPO_DIR=/home/pasha/temp/repo.local/
FROM=/home/pasha/imus/IdeaProjects/imus/
find $FROM -name '*.noarch.rpm' -exec mv {} $LOCAL_REPO_DIR \;
set -x
function repoUpdate(){
#$1 - In repodir.
#$2 - Out dir where placed repodata directory
#$3 - Logfile.
# Due to BUG https://bugzilla.redhat.com/show_bug.cgi?id=449201 use option -C is not possible now
# New BUG - https://bugzilla.redhat.com/show_bug.cgi?id=512610
# --checksum sha for compatability with EPEL5
nice -n 19 createrepo --update --checksum sha -Cvpd -o "$1" "$2" | tee -a "$3"
#nice -n 19 createrepo -vpd -o "$1" "$2" | tee -a "$3"
}
repoUpdate "$LOCAL_REPO_DIR" "$LOCAL_REPO_DIR" "/home/pasha/repomirror.log"
RSYNC_SHARED_OPTIONS='-arlDSzv --stats --human-readable --partial --progress --itemize-changes'
# Local
#rsync $RSYNC_SHARED_OPTIONS --delete "$LOCAL_REPO_DIR" "/var/www/html/repo/" | tee /home/pasha/rsync_mirror.log
rsync $RSYNC_SHARED_OPTIONS --delete "$LOCAL_REPO_DIR" "[email protected]:/var/www/html/repo/" | tee /home/pasha/rsync_mirror.log