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}
<li><a href="{$UI_BROWSER}?act=SUBJECTS.chgPasswd&id={$USER.userid}">##Change Password##</a></li>
{/if}
{if $SUBJECTS->isMemberOf('Admin')}
{if $SUBJECTS->isMemberOf('Admins')}
<li><a href="{$UI_BROWSER}?act=fileList&id={$START.fid}">##File List##</a></li>
{/if}
{if $SUBJECTS->isMemberOf('Backup')}

View file

@ -68,7 +68,8 @@ class uiExchange
header('Content-Length: '.filesize($check['tmpfile']));
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']);
}

View file

@ -3,12 +3,15 @@
# param $1: workdir what we would like to tar
# param $2: output file: the .tar file
# param $3: statusfile
date +\=\=\>%Y%m%d\ %H:%M:%S
echo "backup2.sh: create tarball $1 to $2<=="
echo "==>"
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;
touch $2 || { echo -n "fail" > $3; exit 1; }
#sleep 120
cd $1
tar cf $2 * || { echo -n "fail" > $3; exit 1; }
echo -n "success" > $3
echo -n "success" > $3

View file

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