setFallbackAutoloader(true); // load configuration $config = new Zend_Config_Ini('../application/config.ini', 'general'); $registry = Zend_Registry::getInstance(); $registry->set('config', $config); // setup database $db = Zend_Db::factory($config->db); $date=$_REQUEST["date"]; if (empty($date)) $date="2010-11-01"; $sql="select dataorder.userid,dataset.path from dataorder left join dataset on dataorder.uuid=dataset.uuid where dataorder.status=5 and dataorder.offlineappid>0 and dataset.path<>'' and (dataorder.ts_approved+interval '1 minute')>='".$date."'"; $rs=$db->fetchAll($sql); print '# date: '.$date."\n"; foreach($rs as $r) { print '# path: '.$r['path']."\n"; print 'mkdir -p "/home/ftp/westdc_'.$r['userid'].'/'.basename($r['path']).'"'."\n"; print 'mount --bind "'.$r['path'].'" "/home/ftp/westdc_'.$r['userid'].'/'.basename($r['path']).'"'."\n"; } //todo: add umount command if user has downloaded the data ?>