Raised This Month: $12 Target: $400
 3% 

[Linux][BZ2/FastDL] Auto bz2 + FastDl Upload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AmeriK
Junior Member
Join Date: Jul 2016
Location: Not here
Old 01-25-2017 , 14:12   [Linux][BZ2/FastDL] Auto bz2 + FastDl Upload
Reply With Quote #1

Hello !
For those who want, I released a small bash script to automate FastDL!
Just put it in the parent folder of the server, configure it and run it!
This may take a while (compress to .bz2, upload only .bz2 with lftp and delete .bz2 from game server)...

Configuration :
  1. NOW DEPEND ON LFTP : on Debian distributions :
    Code:
    apt-get install lftp
  2. Modify script, according to game server folders.
  3. Upload it (make it executable).
  4. Run it!
  5. Have a coffee :-) (or a tea!)
  6. Enjoy !
Configuration example :

Code:
# -- CONFIGURATION --

# FTP HostName
HOST='ftp.yourwebsite.com'

# FTP User
USER='myFTPAccount'
# User password
PASSWD='DatSecretPassword'

# / ! \ MAKE SURE MAT, MAP, MOD & SOU ARE ACCORDING TO YOUR "/gamemod/materials/", "/gamemod/maps/", "/gamemod/models/", "/gamemod/sound/" folders !!!
MAT='/home/username/server/serverfiles/gamemode/materials/'
MAP='/home/username/server/serverfiles/gamemode/maps/'
MOD='/home/username/server/serverfiles/gamemode/models/'
SOU='/home/username/server/serverfiles/gamemode/sound/'

# Location to your LOCAL game mode (tf, cs,...)
LOCAL_GM='/home/username/server/serverfiles/gamemode/'

# Location on FastDL server where you want upload (according to fastdl_url)
DISTA_GM='gamemod/'

# -- !CONFIGURATION --
You found an improvement ? MP me !

Have fun <3
Attached Files
File Type: zip fastdl.zip (866 Bytes, 407 views)
__________________
Still loading...

Last edited by AmeriK; 02-04-2017 at 13:55. Reason: New version ! (v 2.0)
AmeriK is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 01-25-2017 , 14:28   Re: Auto upload on FastDl server :D
Reply With Quote #2

Very resourceful! Thanks for post!
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-25-2017 , 14:31   Re: Auto upload on FastDl server :D
Reply With Quote #3

Shouldn't this be in Snippets and Tutorials section?
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 01-25-2017 , 14:47   Re: Auto upload on FastDl server :D
Reply With Quote #4

Quote:
Originally Posted by KissLick View Post
Shouldn't this be in Snippets and Tutorials section?
Yep, moved!
__________________
sneaK is offline
AmeriK
Junior Member
Join Date: Jul 2016
Location: Not here
Old 01-25-2017 , 15:00   Re: Auto upload on FastDl server :D
Reply With Quote #5

Tanks ! <3
AmeriK is offline
Ssand
Member
Join Date: Jan 2017
Old 01-31-2017 , 10:03   Re: Auto upload on FastDl server :D
Reply With Quote #6

Where to paste this file : fastdl.sh ?
Ssand is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 01-31-2017 , 11:37   Re: Auto upload on FastDl server :D
Reply With Quote #7

This could be improved a bit to avoid bzipping a lot of files that where previously transferred by the use of a time tracker file.

This is not tested
Code:
#!/usr/bin/sh
HOST='ftp.domain.com'
USER='my_username'
PASSWD='dat_secret_password_#42'
TRACKFILE='/home/user/serverfiles/tf/transferTimeTracker'

MAT='/home/user/serverfiles/tf/materials/'
MAP='/home/user/serverfiles/tf/maps/'
MOD='/home/user/serverfiles/tf/models/'
SOU='/home/user/serverfiles/tf/sound/'

TIME_COMP=''
if test -f $TRACKFILE
then
    TIME_COMP='-and -newer $TRACKFILE'
fi

find $SOU -not -name \*.bz2 $TIME_COMP -exec bzip2 -k \{\} \;
find $MAT -not -name \*.bz2 $TIME_COMP -exec bzip2 -k \{\} \;
find $MAP -not -name \*.bz2 $TIME_COMP -exec bzip2 -k \{\} \;
find $MOD -not -name \*.bz2 $TIME_COMP -exec bzip2 -k \{\} \;

touch $TRACKFILE

ncftpput -R -v -u $USER -p $PASSWD $HOST /tf/ $SOU \{\} \;

ncftpput -R -v -u $USER -p $PASSWD $HOST /tf/ $MAT \{\} \;

ncftpput -R -v -u $USER -p $PASSWD $HOST /tf/ $MAP \{\} \;

ncftpput -R -v -u $USER -p $PASSWD $HOST /tf/ $MOD \{\} \;

find $SOU -name \*.bz2 -exec rm \{\} \;
find $MOD -name \*.bz2 -exec rm \{\} \;
find $MAP -name \*.bz2 -exec rm \{\} \;
find $MAT -name \*.bz2 -exec rm \{\} \;



exit 0
h3bus is offline
AmeriK
Junior Member
Join Date: Jul 2016
Location: Not here
Old 02-03-2017 , 12:45   Re: Auto upload on FastDl server :D
Reply With Quote #8

You can post everywhere !
Just check : path to mat / sound / maps / mod in fastdl.sh according to your mat / sound / maps / mod folders !
Make sure you can exec this file and permissions
__________________
Still loading...
AmeriK is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode