SCP Backup Upload
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.
What is the best way to do that ? I used the scp until now.
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
@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.
Would be good to have a setting such as :
# Available modes : scp ; rsync
mode=""
Agreed. Some less secure methods (FTP/FTPS) may be worthwhile, as well, as not everyone has secure transfer methods available to their storage.
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.
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.
This feature would have to be well thought out
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".
link #2106