DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦717373b10⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Do_Backup, seg_001bc0

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Time_Utilities;
with System_Backup;
with Calendar;
with Profile;
with Message;
with Daemon;
with Tape;
with Log;
with Io;

procedure Do_Backup (Variety     : System_Backup.Kind := System_Backup.Full;
                     Starting_At : String             := "") is
    Warning           : Duration;
    Start_Message     : Boolean;
    Finish_Message    : Boolean;
    Got_Snapshot_Info : Boolean := False;

    Delay_For : Duration;

    procedure Reset_Snapshot is
    begin
        if Got_Snapshot_Info then
            -- Restore snapshot warning to previous setting
            Daemon.Snapshot_Warning_Message (Interval => Warning);
            Daemon.Snapshot_Start_Message (Start_Message);
            Daemon.Snapshot_Finish_Message (Finish_Message);
        end if;
    end Reset_Snapshot;


    function New_Vol_Id return String is
        use Calendar;
        Now        : Calendar.Time   := Calendar.Clock;
        Base_Time  : constant String := "July 16, 1986 at 00:00:01 AM";
        Base       : Calendar.Time   := Time_Utilities.Convert_Time
                                           (Time_Utilities.Value (Base_Time));
        Time_Since : Duration        := Now - Base;
        Digit      : constant String := "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        N          : Integer         := Integer (Time_Since) / 2;
        D          : Integer;
        Volid      : String (1 .. 6) := "******";
    begin
        -- n is the (number of seconds since the base time) / 2.
        -- Treating this as a base 36 value, we take the image
        -- of it base 36.  This will yield a unique 6 character
        -- value consisting of an alphabetic followed by 5 alpha_numerics.
        -- In 99 years, the first character will become numeric,
        -- making these values collide with the volids
        -- generated by the operator interface.

        for I in reverse Volid'Range loop
            D         := N mod Digit'Length;
            Volid (I) := Digit (D + 1);
            N         := N / Digit'Length;
        end loop;
        if N /= 0 then
            Log.Put_Line ("Time since base time has overflowed 6 digits.");
        end if;
        Log.Put_Line ("The backup tape's Volid is " & Volid);
        return Volid;
    end New_Vol_Id;
begin
    if Starting_At'Length > 0 then
        begin
            Tape.Format_Tape (Drive => 0, Vol_Id => New_Vol_Id);

            Delay_For := Time_Utilities.Duration_Until
                            (Time_Utilities.Value (Starting_At));
            delay Delay_For;
        exception
            when others =>
                Log.Put_Line ("Invalid starting time value given.",
                              Kind => Profile.Error_Msg);
        end;
    end if;

    -- Warn users that backup is starting
    Message.Send_All ("Starting system backup");

    -- Save current snapshot settings and turn off snapshot warnings.
    Daemon.Get_Snapshot_Settings (Warning, Start_Message, Finish_Message);
    Got_Snapshot_Info := True;
    Daemon.Snapshot_Warning_Message (Interval => 0.0);
    Daemon.Snapshot_Start_Message;

    -- Do the backup
    System_Backup.Backup (Variety => Variety);

    -- Take snapshot to make full backups official; i.e. allow differentials
    Daemon.Run ("Snapshot");

    Reset_Snapshot;
exception
    when others =>
        Io.Put_Line (Io.Current_Error,
                     "Backup failed with an unhandled exception.");
        Reset_Snapshot;
end Do_Backup;
pragma Main;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=23 rec1=00 rec2=01 rec3=032
        [0x01] rec0=00 rec1=00 rec2=05 rec3=026
        [0x02] rec0=12 rec1=00 rec2=06 rec3=050
        [0x03] rec0=02 rec1=00 rec2=02 rec3=044
        [0x04] rec0=1c rec1=00 rec2=03 rec3=014
        [0x05] rec0=12 rec1=00 rec2=04 rec3=000
    tail 0x20100f1ee7da18d656bc9 0x42a00088462065003