phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] again, my changes to the backup scripts


From: ceb
Subject: Re: [Phpgroupware-developers] again, my changes to the backup scripts
Date: Sun, 3 Feb 2002 23:20:41 +0100 (CET)

hey,
i misunderstood the backup_homedir functionality than (should have looked
at the code ;P) on my system all phpgw_users also have a homdir to store
their mails, but they do not have a loginshell. so the backup_mail and
backup_home archives would contain the same files... also i dont think we
should mix the backup of phpgw with a system backup. the only additional
dirs to backup i would like to include are the user/group file dirs from
filemanager/phpgwwebhosting. but im not sure which one of these apps will
continue as the phpgw filemanager... or both of them... :) so i leaved
this out for now.
after some more testing your first modified get_rdate function works
here. i moved the function calls after saving the backup_archives and
added one hour to mktime. now it keeps the correct number of archives.

the function you sent now has the prob if the intervall isnt set to
monthly it would build the month_part as '1+'
$diff = mktime(1,0,0,1 + $dm,1 + $dd,1970);
grtx. ceb


On Sun, 3 Feb 2002, Aiko Mastboom wrote:

> Hi,
>
> You're right.. my get_rdate alterations fails :(
> not to worry I did some searching on the net and found this:
>
> http://php2.chek.com/manual/en/ref.datetime.php
> address@hidden
> 07-Feb-2001 05:23
>
> Some general date functions.
>
> function sub($timestamp, $seconds,$minutes,$hours,$days,$months,$years) {
>       $mytime =
> mktime(1+$hours,0+$minutes,0+$seconds,1+$months,1+$days,1970+$years);
>       return $timestamp - $mytime;
> }
> ...
>
> I incorperated the above into the get_rdate function and came up with:
>
> function get_rdate($versions, $bintval)
> {
>   switch($bintval)
>   {
>     case 'daily':   $dd = $versions; break;
>     case 'weekly':  $dd = ( 7 * $versions ); break;
>     case 'monthly': $dm = $versions; break;
>   }
>   $today = mktime(0,0,0,date('m'),date('d'),date('Y'));
>   $diff = mktime(1,0,0,1 + $dm,1 + $dd,1970);
>   return $today - $diff;
> }
>
> I did some tests with the attached file and it seems to work ok :)
>
> About the home dir thingy:
> I made the changes so the backup scripts backup the homedirs of the users who 
> also
> have an ordinary login account. it does not copy anything into any homedir, 
> it just
> backs up the /home/* for users who also have an groupware account.
>
> I haven't tested your changes yet, will do soon (from what I saw from the
> http://savannah.gnu.org/cgi-bin/viewcvs/phpgroupware/backup/ it looks ok)
>
> cheerz,
>
> Aiko
>
> address@hidden wrote*:
> >
> >hey Aiko,
> >i added a site configuration page to backup in head cvs to make the
> >paths of the needed apps/db_dirs configurable. so this should work now
> >also for your system without to edit the scripts manually. keeping only a
> >number of backup versions still doesnt work correctly, also your
> >suggestion didnt have the right result here :)
> >to copy the whole backup of phpgw in any users homedir doesnt make sense
> >to me, will not go into cvs.
> >please check, if anything else is working now for you.
> >grtx. ceb
> >
> >[have a lot of funk]
> >
> >----------------------------------------
> >
> >On Wed, 30 Jan 2002, Aiko Mastboom wrote:
> >
> >> Hi,
> >>
> >> I've been fiddling with the backup scripts again and like to share my 
> >> changes
> with you.
> >>
> >> in short:
> >> I added support for /home dirs (only when /home matches a user on the 
> >> system)
> >> I changed some stuf to reflect my setup
> >>
> >> or just browse the diff file and see for yourself what I changed and if 
> >> you want to
> >> incorporate them in your setup...
> >>
> >> major changes:
> >> - inc/class.bobackup.inc.php,
> >> - inc/class.uibackup.inc.php,
> >> - templates/default/admin_form.tpl,
> >> - default/script_form.tpl
> >> -- added support for homedir backup
> >>
> >> minor changes:
> >> - default/backup_form.tpl
> >> -- added location of my php installation to the path variable
> >>
> >> - default/script_form.tpl
> >> -- changed bdateout to day_month_year cause I like it better that way..
> >> -- changed the switch($bintval) again, cause on my machine the math still 
> >> wasn't
> done :(
> >> -- changed the $end var to $end2 in all if(... == 'tar.bz2) clauses, so 
> >> the $end var
> >> doesn't get overwriten and the next clause doesn't fail anymore
> >> -- changed the ldap dir to correspond to my setup
> >> -- changed the mysql dir to correspond to my setup
> >>
> >> cheers,
> >>
> >> Aiko
> >>
> >
> >
> >_______________________________________________
> >Phpgroupware-developers mailing list
> >address@hidden
> >http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> >
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]