backup changes

This commit is contained in:
csikosjanos 2006-05-09 13:31:03 +00:00
parent 147100823e
commit d83086efa8
4 changed files with 14 additions and 8 deletions

View file

@ -69,7 +69,7 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
{else} {else}
<li><a href="{$UI_BROWSER}?act=SUBJECTS.chgPasswd&id={$USER.userid}">##Change Password##</a></li> <li><a href="{$UI_BROWSER}?act=SUBJECTS.chgPasswd&id={$USER.userid}">##Change Password##</a></li>
{/if} {/if}
{if $SUBJECTS->isMemberOf('Admin')} {if $SUBJECTS->isMemberOf('Admins')}
<li><a href="{$UI_BROWSER}?act=fileList&id={$START.fid}">##File List##</a></li> <li><a href="{$UI_BROWSER}?act=fileList&id={$START.fid}">##File List##</a></li>
{/if} {/if}
{if $SUBJECTS->isMemberOf('Backup')} {if $SUBJECTS->isMemberOf('Backup')}

View file

@ -68,7 +68,8 @@ class uiExchange
header('Content-Length: '.filesize($check['tmpfile'])); header('Content-Length: '.filesize($check['tmpfile']));
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename="'.basename($check['tmpfile']).'"'); $newname='backup_'.date("Ymd", filectime($check['tmpfile'])).'.tar';
header('Content-Disposition: attachment; filename="'.$newname.'"');
readfile($check['tmpfile']); readfile($check['tmpfile']);
} }

View file

@ -3,8 +3,11 @@
# param $1: workdir what we would like to tar # param $1: workdir what we would like to tar
# param $2: output file: the .tar file # param $2: output file: the .tar file
# param $3: statusfile # param $3: statusfile
date +\=\=\>%Y%m%d\ %H:%M:%S echo "==>"
echo "backup2.sh: create tarball $1 to $2<==" date +\ %Y%m%d\ %H:%M:%S
echo "backup2.sh: create tarball $1 to $2"
echo "backup2.sh: status: #$3#"
echo "<=="
echo -n "working" > $3; echo -n "working" > $3;
touch $2 || { echo -n "fail" > $3; exit 1; } touch $2 || { echo -n "fail" > $3; exit 1; }
#sleep 120 #sleep 120

View file

@ -140,9 +140,10 @@ class Backup {
* *
* @param token : token * @param token : token
* @return hasharray with field: * @return hasharray with field:
* status : string - susccess | working | fault * status : string - susccess | working | fault
* token : stirng - backup token * token : stirng - backup token
* url : string - access url * url : string - access url
* tmpfile : string - access filename
*/ */
function checkBackup($token) { function checkBackup($token) {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
@ -154,6 +155,7 @@ class Backup {
switch ($status) { switch ($status) {
case 'success': case 'success':
$r['url'] = $this->gb->getUrlPart()."access/$token.".BACKUP_EXT; $r['url'] = $this->gb->getUrlPart()."access/$token.".BACKUP_EXT;
$r['tmpfile'] = $this->gb->accessDir."/$token.".BACKUP_EXT;
case 'working': case 'working':
case 'fault': case 'fault':
$r['status'] = $status; $r['status'] = $status;