LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

SCP Backup Upload

Open UltimateByte opened this issue 9 years ago • 10 comments

Just thought it would be great to have an FTP upload function (ftp_upload.sh ?).

Would be available for the Backup function (pretty nice to have a backup elsewhere), and FastDL function (pretty nice to be able to upload your FastDL files to another server).

PS : I'm of course OK to work on it.

UltimateByte avatar Feb 25 '16 11:02 UltimateByte

What is the best way to do that ? I used the scp until now.

UltimateByte avatar Feb 26 '16 12:02 UltimateByte

why not use a web app ? I have coded (in PHP) the ability to 'copy' files from one sever to another, assuming the destination has the correct privs set it looks a bit like this $docs = "http://remotelocation.com/games/gmod/backups/"; $filename = $docs."backup.zip"; if(!@copy($filename,'new.zip')) { echo "file not found at the remote location"; } else { echo "we have done a file copy" } this does also assume you have apache running and a FQDN

JimTR avatar Mar 15 '16 18:03 JimTR

@UltimateByte scp is generally the best way to move files from one server to another. rsync is another option. It kind of depends on where you're sending the files.

seancallaway avatar Mar 17 '16 19:03 seancallaway

Would be good to have a setting such as :

# Available modes : scp ; rsync 
mode=""

UltimateByte avatar Mar 17 '16 23:03 UltimateByte

Agreed. Some less secure methods (FTP/FTPS) may be worthwhile, as well, as not everyone has secure transfer methods available to their storage.

seancallaway avatar Mar 17 '16 23:03 seancallaway

Yep, good idea. That will be a pain to program, mostly because i'm not used to rsync and to remote line file transfer, but challenge accepted.

BTW, i'm not sure how to implement the function. I'm opened to any idea.

Should i make a function that accepts an input, so that we can use it to within other functions, to upload stuff like logs or custom folders ? Should we make a specific function, such as ./gameserver backup-upload ? Should the backup be configurable by some way before, so that the backup function would upload after backing up ?

Which leads me to : Will this require a backup function update for settings ? Such as :

  • How many backups do you wanna keep ?
  • Do you want to delete the backup after uploading ?

This would probably be available for the next big LGSM update (will be retro-compatible, no worries), and require an external config file for backup. That config file could be created either while running the backup function for the first time, or in a check that woul be started while running any function.

UltimateByte avatar Mar 18 '16 00:03 UltimateByte

i'm not used to rsync and to remote line file transfer, but challenge accepted.

I'm a Linux Sys Admin. Remote transfer scripts are my bread and butter. Would be happy to send you some samples.

Should we make a specific function, such as ./gameserver backup-upload ?

I would say this. If you try to make it an generic uploading script, it loses some of its usefulness, IMHO.

seancallaway avatar Mar 18 '16 20:03 seancallaway

This feature would have to be well thought out

dgibbs64 avatar Mar 18 '16 23:03 dgibbs64

Well, we alked about that with Daniel, we will probably keep the existing backup, but make an auto-backup function, that would require to setup a config file in which you could setup an upload. Would probably come with the next major LGSM update. Upon first start : "A config file has been created : lgsm/auto-backup.cfg, please, edit it first".

UltimateByte avatar Mar 18 '16 23:03 UltimateByte

link #2106

MicLieg avatar Feb 25 '24 17:02 MicLieg