3 # invoke this as root on mire
7 # drop any tokens; use only users' cgi tokens
8 kdestroy
> /dev
/null
2>&1
14 LOCAL_LOG_DIR
=/var
/log
/apache2
15 KEYTAB_DIR
=/etc
/keytabs
/user.daemon
16 AFS_USER_DIR
=/afs
/hcoop.net
/user
19 for A
in $
(find $LOCAL_LOG_DIR/user
-mindepth 3 -maxdepth 3 -print); do
21 PATHBITS
=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
23 LOG_DEST
=$AFS_USER_DIR/$PATHBITS/.logs
/apache
/
26 if [ "$VERBOSE" = "true" ]; then
28 echo "=============================================================================="
29 echo "syncing logs for $USER from $A"
30 echo " to $LOG_DEST ..."
33 if [ ! -d "$LOG_DEST" ]; then
34 echo "Error: $LOG_DEST does not exist, please make it"
38 cp -r $LOG_SRC $TMP_DEST
39 chmod -R u
=rwX
,go
=X
$TMP_DEST
40 # There is an issue here. With nocelic and magnus, doing su
41 # $USER will cause rsync to not be able to read $LOG_DEST,
42 # even if it is first chown'ed to $USER. So we have to just
43 # be root, and not change ownership or group when copying the
44 # files. This makes group be root on AFS, but that shouldn't
45 # matter for anything important. Perhaps some PAM issue is
46 # related to this, since even read/write to local filesystem
48 k5start
-qtU -f $KEYTAB_DIR/$USER \
49 -- rsync
-a --no-o --no-g $TMP_DEST/ $LOG_DEST/
51 [ "$VERBOSE" = "true" ] && echo " done."
55 if [ "$ERROR" = "yes" ]; then