Fórum Rotina de Backup #216073
23/02/2004
0
oi galera,
eu queria saber como que fazo para fazer uma rotina de backup em rede,
por exemplo:
pegar tudo que esta na pasta c:\meuprograma de todos os computadores que estao na rede
obrigado
eu queria saber como que fazo para fazer uma rotina de backup em rede,
por exemplo:
pegar tudo que esta na pasta c:\meuprograma de todos os computadores que estao na rede
obrigado
Anicetojunior
Curtir tópico
+ 0
Responder
Posts
23/02/2004
Vanila
Aí federal não sei se isso vai te ajudar, mas acredito que pode ser um ponto de partida...............
Pra vc ter uma ideia dos controles usados
object Label2: TLabel
Left = 168
Top = 40
Width = 123
Height = 13
Caption = ´C:\...\Delphi Projects\bkp´
end
object Label4: TLabel
Left = 168
Top = 16
Width = 49
Height = 24
Caption = ´Para:´
Font.Charset = DEFAULT_CHARSET
Font.Color = clRed
Font.Height = -19
Font.Name = ´MS Sans Serif´
Font.Style = [fsBold]
ParentFont = False
end
object btncopiar: TBitBtn
Left = 320
Top = 56
Width = 99
Height = 25
Caption = ´Copiar´
TabOrder = 0
OnClick = btncopiarClick
end
object dir_2: TDirectoryListBox
Left = 168
Top = 56
Width = 145
Height = 145
DirLabel = Label2
ItemHeight = 16
TabOrder = 4
end
object file_1: TFileListBox
Left = 320
Top = 88
Width = 145
Height = 169
ItemHeight = 13
TabOrder = 7
Visible = False
end
___________________//______________________
E o código..............
procedure T_Backup.btncopiarClick(Sender: TObject);
var
dir,dir2:pchar;
a:integer;
begin
panel1.visible:=true;
dir:=pchar(dir_1.directory);
dir2:=pchar(dir_2.directory);
for a:=0 to file_1.Items.Count do
begin
file_1.itemindex:=a;
prog.progress:=(a*100) div file_1.Items.Count;
copyfile(pchar(dir+´\´+ExtractFilename(file_1.FileName)),pchar(dir2+´\´+ExtractFilename(file_1.FileName)),true);
end;
panel1.visible:=false;
end;
procedure T_Backup.BitBtn5Click(Sender: TObject);
var
dir:string;
begin
dir:=InputBox(´Criar diretório´,´Digite o nome do diretório´,´´);
createdir(pchar(dir_1.directory+´\´+dir));
dir_1.Update;
end;
procedure T_Backup.BitBtn4Click(Sender: TObject);
var
dir:string;
begin
dir:=InputBox(´Criar diretório´,´Digite o nome do diretório´,´´);
createdir(pchar(dir_2.directory+´\´+dir));
dir_2.Update;
end;
end.
Falow ?
Pra vc ter uma ideia dos controles usados
object Label2: TLabel
Left = 168
Top = 40
Width = 123
Height = 13
Caption = ´C:\...\Delphi Projects\bkp´
end
object Label4: TLabel
Left = 168
Top = 16
Width = 49
Height = 24
Caption = ´Para:´
Font.Charset = DEFAULT_CHARSET
Font.Color = clRed
Font.Height = -19
Font.Name = ´MS Sans Serif´
Font.Style = [fsBold]
ParentFont = False
end
object btncopiar: TBitBtn
Left = 320
Top = 56
Width = 99
Height = 25
Caption = ´Copiar´
TabOrder = 0
OnClick = btncopiarClick
end
object dir_2: TDirectoryListBox
Left = 168
Top = 56
Width = 145
Height = 145
DirLabel = Label2
ItemHeight = 16
TabOrder = 4
end
object file_1: TFileListBox
Left = 320
Top = 88
Width = 145
Height = 169
ItemHeight = 13
TabOrder = 7
Visible = False
end
___________________//______________________
E o código..............
procedure T_Backup.btncopiarClick(Sender: TObject);
var
dir,dir2:pchar;
a:integer;
begin
panel1.visible:=true;
dir:=pchar(dir_1.directory);
dir2:=pchar(dir_2.directory);
for a:=0 to file_1.Items.Count do
begin
file_1.itemindex:=a;
prog.progress:=(a*100) div file_1.Items.Count;
copyfile(pchar(dir+´\´+ExtractFilename(file_1.FileName)),pchar(dir2+´\´+ExtractFilename(file_1.FileName)),true);
end;
panel1.visible:=false;
end;
procedure T_Backup.BitBtn5Click(Sender: TObject);
var
dir:string;
begin
dir:=InputBox(´Criar diretório´,´Digite o nome do diretório´,´´);
createdir(pchar(dir_1.directory+´\´+dir));
dir_1.Update;
end;
procedure T_Backup.BitBtn4Click(Sender: TObject);
var
dir:string;
begin
dir:=InputBox(´Criar diretório´,´Digite o nome do diretório´,´´);
createdir(pchar(dir_2.directory+´\´+dir));
dir_2.Update;
end;
end.
Falow ?
Responder
Gostei + 0
24/02/2004
Anicetojunior
valeuuu
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)