We use moving light patterns to control the motion of Escherichia coli bacteria whose motility is photo-activated. Varying the pattern speed controls the magnitude and direction of the bacterial flux, and therefore the accumulation of cells in up- and down-stream reservoirs. We validate our results with two-dimensional simulations and a 1-dimensional analytic model, and use these to explore parameter space. We find that cell accumulation is controlled by a competition between directed flux and undirected, stochastic transport. Our results point to a number of design principles for using moving light patterns and light-activated micro-swimmers in a range of practical applications.