#!/bin/bash set -x # ==BEGIN # This script is used to synchronize my webrepo # with my local files if something changed # This script doesnt acceot an opts. # ==AUTHOR # Norbert Varzariu #==END _myLogin="276373-ftp" _myUrl="ftp.loomsen.org:/" _myMntPt="/webz" _myDomain="loomsen.homelinux.net" # basic sanity check:fc12-x86_64 if [ ! -d "$_myMntPt" -o ! -w "$_myMntPt" ]; then echo "designated mount point isn't writable!" exit $? fi # mountIt-o uid=502 -o gid=502 -o umask=000 sshfs "$_myLogin"@"$_myUrl" "$_myMntPt" ## rsync will fail cause it uses mkdir without -p ## so lets make sure the destination is exists mkdir -p "$_myMntPt"/repo/{SRPMS,SPECS,RPMS{/x86_64,/noarch}} # rsync -r $HOME/rpmbuild/RPMS "$_myMntPt"/repo/ rsync -r $HOME/rpmbuild/SRPMS "$_myMntPt"/repo/ rsync -r $HOME/rpmbuild/SPECS "$_myMntPt"/repo/ createrepo --database --unique-md-filenames --update "$_myMntPt"/repo/RPMS/x86_64 createrepo --database --unique-md-filenames --update "$_myMntPt"/repo/RPMS/noarch createrepo --database --unique-md-filenames --update "$_myMntPt"/repo/SRPMS ## Done with out update, let's clean up fusermount -u "$_myMntPt" exit $?