Re: [BackupPC-users] restore a backup from command line

2023-11-03 Thread G.W. Haywood via BackupPC-users

Hi there,

On Fri, 3 Nov 2023, Ghislain Adnet wrote:


? Well i saw the exemples but they seems to create tar on the backup
server then moving the tar then untar it.

? unfortunatly I do not have the disk space for that nor on the
backup server nor on the destination server :(

?I would like to do a restore the same way i do it in the web
interface to automate this but seems there is not a tool for it.


I think what you're looking for is 'BackupPC_tarCreate'.  You will
find it mentioned in both the BackupPC FAQ and in the list archives
(at least eight hundred times by my quick count this evening).

--

73,
Ged.


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] restore a backup from command line

2023-11-03 Thread Bowie Bailey via BackupPC-users

On 11/3/2023 6:23 AM, Ghislain Adnet wrote:
Evidently "BackupPC_restore" is to be used only through the CGI. 
Follow the link to documentation from within the CGI and once there 
look for the title "Command-line restore options" where you will find 
the recommended commands and a some examples usages.


thanks,

  Well i saw the exemples but they seems to create tar on the backup 
server then moving the tar then untar it.


  unfortunatly I do not have the disk space for that nor on the backup 
server nor on the destination server :(


 I would like to do a restore the same way i do it in the web 
interface to automate this but seems there is not a tool for it.


It's not the cleanest solution, but since BackupPC_tarCreate writes to 
stdout, you can stream the tar file over the network via ssh and then 
extract it on the remote machine without ever saving the tar file on 
either server.


(untested)
BackupPC_tarCreate ... | ssh user@destination 'cat | tar -x -C 
/destinationdir'


You can do the same thing with BackupPC_zipCreate and use tar -xz to 
extract on the other side if you want compression other than what is 
provided by ssh.


You can also pipe the tar/zip data through pv if you want some progress 
information on the copy.


(also untested)
BackupPC_zipCreate ... | pv | ssh user@destination 'cat | tar -xz -C 
/destinationdir'


--
Bowie___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] restore a backup from command line

2023-11-03 Thread Ghislain Adnet

Evidently "BackupPC_restore" is to be used only through the CGI. Follow the link to 
documentation from within the CGI and once there look for the title "Command-line restore 
options" where you will find the recommended commands and a some examples usages.


thanks,

  Well i saw the exemples but they seems to create tar on the backup server 
then moving the tar then untar it.

  unfortunatly I do not have the disk space for that nor on the backup server 
nor on the destination server :(

 I would like to do a restore the same way i do it in the web interface to 
automate this but seems there is not a tool for it.

--
cordialement,
Ghislain ADNET.
AQUEOS.
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] restore a backup from command line

2023-10-31 Thread jbk

On 10/30/23 12:45, Ghislain Adnet wrote:

hi,

 i was wondering if there was any way to restore from the 
command line. I need to restore all /home/ daily to 
another server



 I was trying to use


/usr/share/backuppc/bin/BackupPC_restore


 but there is no docs and it fails for me as i try various 
things like


[~]: sudo -u backuppc 
/usr/share/backuppc/bin/BackupPC_restore 127.0.0.1 
myclientserver.com  /etc/vim/vimrc
/usr/share/backuppc/bin/BackupPC_restore: bad reqFileName 
(arg #3): /etc/vim/vimrc


usage: /usr/share/backuppc/bin/BackupPC_restore [-p] [-v] 
[-m]   



any idea if this is possible ?
--
cordialement,
Ghislain ADNET.
AQUEOS.
Evidently "BackupPC_restore" is to be used only through the 
CGI. Follow the link to documentation from within the CGI 
and once there look for the title "Command-line restore 
options" where you will find the recommended commands and a 
some examples usages.


--
Jim KR

___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


Re: [BackupPC-users] restore a backup from command line

2023-10-31 Thread G.W. Haywood via BackupPC-users

Hi there,
On Tue, 31 Oct 2023, Ghislain Adnet wrote:


?i was wondering if there was any way to restore from the command
line. I need to restore all /home/ daily to another server

?I was trying to use


/usr/share/backuppc/bin/BackupPC_restore


?but there is no docs and it fails for me as i try various things like

[~]: sudo -u backuppc /usr/share/backuppc/bin/BackupPC_restore 127.0.0.1 
myclientserver.com? /etc/vim/vimrc
/usr/share/backuppc/bin/BackupPC_restore: bad reqFileName (arg #3): 
/etc/vim/vimrc

usage: /usr/share/backuppc/bin/BackupPC_restore [-p] [-v] [-m]   



any idea if this is possible ?


I'm sure it's possible, but not like that. :(

If I look at the code in BackupPC_restore (it's at line 72 in my
version but that's from 2020, yours may be different) I see

if ( $ARGV[2] !~ /^([\w.]+)$/ ) {
print("$0: bad reqFileName (arg #3): $ARGV[2]\n");
exit(1);
}

This tells me that you can't have anything other than a "word character"
or a dot in the third argument.  The '/' character isn't allowed.

$ perl -e '$word = "hello"; if( $word =~ /^([\w\.]+)$/ ) { print "matches\n"; } else { 
print "does not match\n"; }'
matches
$ perl -e '$word = "hello.world"; if( $word =~ /^([\w\.]+)$/ ) { print "matches\n"; } 
else { print "does not match\n"; }'
matches
$ perl -e '$word = "hello/world"; if( $word =~ /^([\w\.]+)$/ ) { print "matches\n"; } 
else { print "does not match\n"; }'
does not match
$

I suspect you might find an answer more to your liking in the mailing
list archives.

--

73,
Ged.


___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/


[BackupPC-users] restore a backup from command line

2023-10-30 Thread Ghislain Adnet

hi,

 i was wondering if there was any way to restore from the command line. I need 
to restore all /home/ daily to another server


 I was trying to use


/usr/share/backuppc/bin/BackupPC_restore


 but there is no docs and it fails for me as i try various things like

[~]: sudo -u backuppc /usr/share/backuppc/bin/BackupPC_restore 127.0.0.1 
myclientserver.com  /etc/vim/vimrc
/usr/share/backuppc/bin/BackupPC_restore: bad reqFileName (arg #3): 
/etc/vim/vimrc

usage: /usr/share/backuppc/bin/BackupPC_restore [-p] [-v] [-m]   



any idea if this is possible ?

--
cordialement,
Ghislain ADNET.
AQUEOS.
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/