Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 18:52.


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