r78777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78776‎ | r78777 | r78778 >
Date:09:57, 22 December 2010
Author:rfaulk
Status:deferred (Comments)
Tags:
Comment:
#!/bin/bash


# Get the date and hour
ymd=$(date +%Y-%m-%d)
hr=$(date +%H)
let hr=$((10#$hr)) # convert to decimal

# Look at the previous hour
if [ $hr -gt 0 ]; then
let hr=hr-1
else
hr=23
ym=$(date +%Y-%m)
day=$(date +%d)
let day=$((10#$day))-1

if [ $day -lt 10 ]; then
day="0${day}"
fi

ymd="${ym}-${day}"
fi

# Account for the 24hr clock
# determine if it is the afternoon
if [ $hr -gt 11 ]; then
if [ $hr -ne 12 ]; then
let hr=hr-12
fi
part="PM"
else
if [ $hr -eq 0 ]; then
let hr=12
fi
part="AM"
fi

#echo $hr
#echo $part

# Form the identifier string
if [ $hr -lt 10 ]; then
T="${ymd}-0${hr}${part}"
else
T="${ymd}-${hr}${part}"
fi

#echo $T


cd /home/rfaulk/fundraiser-statistics/fundraiser-scripts/logs

sftp rfaulk@hume.wikimedia.org:/a/static/uncompressed/udplogs/landingpages-$T*
sftp rfaulk@hume.wikimedia.org:/a/static/uncompressed/udplogs/bannerImpressions-$T*

cd ..

python squid_miner_script.py l ./logs/landingpages-$T* 1>./mine-log/log-banimp-$T.txt 2>./mine-log/log-banimp-$T.txt
python squid_miner_script.py i ./logs/bannerImpressions-$T* 1>./mine-log/log-lp-$T.txt 2>./mine-log/log-lp-$T.txt

cp ./mine-log/log-banimp-$T.txt /srv/org.wikimedia.fundraising/stats/mine-logs
cp ./mine-log/log-lp-$T.txt /srv/org.wikimedia.fundraising/stats/mine-logs
Modified paths:
  • /trunk/fundraiser-statistics/bash/log_copy.sh (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/bash/log_copy.sh
@@ -59,5 +59,5 @@
6060 python squid_miner_script.py l ./logs/landingpages-$T* 1>./mine-log/log-banimp-$T.txt 2>./mine-log/log-banimp-$T.txt
6161 python squid_miner_script.py i ./logs/bannerImpressions-$T* 1>./mine-log/log-lp-$T.txt 2>./mine-log/log-lp-$T.txt
6262
63 -cp ./mine-log/log-banimp-$T.txt /srv/org.wikimedia.fundraising/stats/
64 -cp ./mine-log/log-lp-$T.txt /srv/org.wikimedia.fundraising/stats/
 63+cp ./mine-log/log-banimp-$T.txt /srv/org.wikimedia.fundraising/stats/mine-logs
 64+cp ./mine-log/log-lp-$T.txt /srv/org.wikimedia.fundraising/stats/mine-logs

Comments

#Comment by MZMcBride (talk | contribs)   10:14, 22 December 2010

What's with the funky commit messages?

#Comment by Nikerabbit (talk | contribs)   11:27, 22 December 2010

Perhaps misunderstanding what svn ci -F does?

#Comment by Renklauf (talk | contribs)   18:29, 22 December 2010

Yeah I'm new to commandline svn, I attempted to post the message separately without much luck

#Comment by Catrope (talk | contribs)   18:35, 22 December 2010

svn ci -F filename or svn ci --file=filename will use the contents of filename as the commit summary. To only commit changes to a given file, use svn ci filename. svn ci -m 'Commit message here' or svn ci '--message=Commit message here' allows you to specify the commit message on the command line, but should be handled with care when your commit message contains things like spaces or dollar signs (and most do). The best way is to just run svn ci without the -m or -F flags, which will pop up an editor to let you enter the commit message. If it complains about EDITOR not being set properly, make sure EDITOR is set properly ;)

#Comment by Renklauf (talk | contribs)   18:42, 22 December 2010

Cool thanks, checking in particular files is something I want to be able to do.

#Comment by Reedy (talk | contribs)   18:31, 22 December 2010

You can use svn ci -m " lol text", but it does funky stuff, and it annoys Nikerabbit, among others ;)

Easiest way, is if you do it with no message, and no -F, you get your default text editor opened.

In there, just write what you want, save and close. Jobs a good 'un

#Comment by Renklauf (talk | contribs)   18:34, 22 December 2010

I've mainly been using been using -m (or --message) - seems like the editor is probably the safest way though :) thanks!

Status & tagging log