AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [Linux][BZ2/FastDL] Auto bz2 + FastDl Upload (https://forums.alliedmods.net/showthread.php?t=293209)

AmeriK 01-25-2017 14:12

[Linux][BZ2/FastDL] Auto bz2 + FastDl Upload
 
1 Attachment(s)
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

OSWO 01-25-2017 14:28

Re: Auto upload on FastDl server :D
 
Very resourceful! Thanks for post!

KissLick 01-25-2017 14:31

Re: Auto upload on FastDl server :D
 
Shouldn't this be in Snippets and Tutorials section?

sneaK 01-25-2017 14:47

Re: Auto upload on FastDl server :D
 
Quote:

Originally Posted by KissLick (Post 2489861)
Shouldn't this be in Snippets and Tutorials section?

Yep, moved!

AmeriK 01-25-2017 15:00

Re: Auto upload on FastDl server :D
 
Tanks ! <3

Ssand 01-31-2017 10:03

Re: Auto upload on FastDl server :D
 
Where to paste this file : fastdl.sh ?

h3bus 01-31-2017 11:37

Re: Auto upload on FastDl server :D
 
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


AmeriK 02-03-2017 12:45

Re: Auto upload on FastDl server :D
 
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 :D


All times are GMT -4. The time now is 18:52.

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