anchor.diff:          undefined ->
               %% @doc Return the base name of the dump files. The base name is composed of the date and time.
               %% @todo keep the backup page updated with the state of the current backup.
  -            Now = calendar:local_time(),
  -            Pid = do_backup(erlydtl_dateformat:format(Now, "Ymd-His", State#state.context), State),
  -            {reply, ok, State#state{backup_pid=Pid, backup_start=Now}};
  +            Pid = do_backup(name(State#state.context), State),
  +            {reply, ok, State#state{backup_pid=Pid, backup_start=calendar:local_time()}};
           _Pid ->
               {reply, {error, in_progress}, State}
       end;
  
positive.code: %% @doc Return and ensure the backup directory
  dir(Context) ->
      z_path:files_subdir_ensure(backup, Context).
  
  
  %% @doc Dump the sql database into the backup directory.  The Name is the basename of the dump.
  
negative.code:     lists:reverse(lists:sort([ {filename:rootname(filename:basename(F), ".sql"), filename_to_date(F)} || F <- Files ])).
  
  filename_to_date(File) ->
      R = re:run(filename:basename(File), "([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2})([0-9]{2})([0-9]{2})", [{capture, all, list}]),
      {match, [_, YY, MM, DD, HH, II, SS]} = R,
      Y = list_to_integer(YY),
      M = list_to_integer(MM),
      D = list_to_integer(DD),
      H = list_to_integer(HH),
      I = list_to_integer(II),
      S = list_to_integer(SS),
      {{Y,M,D},{H,I,S}}.
  
  
  