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=date('Y-m-d',strtotime('-2 month')); $sql="select dataorder.userid,dataset.path from dataorder left join dataset on dataorder.uuid=dataset.uuid where dataorder.status in (0,5) and dataset.host='ftp2.westgis.ac.cn' 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 ?>