SRCDS Steam group


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shell auto-bzip2 script
#1
Cool 
Hi everyone.

With what seems to be a sudden change in the way sv_downloadurl works, I find myself constantly having to upload files to my FastDL server now. Unfortuantely, I don't really have the time to go over there myself and bzip2 every one of them. (Or at least the ones I need to.)

So I created this little shell script, which will compress any file that isn't a .bz2 file into a .bz2.

My server is running pure-ftpd as the ftp server, so I can have this script run whenever a file is uploaded to my server. (The first argument is said file.) You'll have to figure out if your ftp server can do the same thing.

Also, if you don't want it to log anything, just remove the echo lines.

And here it is:

Code:
#! /bin/sh

if [ awk '/.bz2' $1 ]
    then
        echo "Weird, $1 is a bz2 file." >> /var/log/autocompress.log
    else
    bzip2 $1
    echo "[$time] $1 has successfully been bzip'd." >> /var/log/autocompress.log
fi
Reply
#2
Moved to correct section.
~ trewq
Reply
#3
(09-06-2010, 10:17 PM)Goilio Wrote:  Moved to correct section.

Alright Smile Should I put a
Code:
[Linux]
tag in the thread title, or are there actually shell script interpreters for windows?

P.S. Why does that tag give you [1inux]

EDIT: Ah, Linux - only readme.
Reply
#4
(09-07-2010, 12:45 AM)tgp1994 Wrote:  
(09-06-2010, 10:17 PM)Goilio Wrote:  Moved to correct section.

Alright Smile Should I put a
Code:
[Linux]
tag in the thread title, or are there actually shell script interpreters for windows?

P.S. Why does that tag give you [1inux]

EDIT: Ah, Linux - only readme.

Na, it should be fine people should know what you are talking about otherwise they shouldn't be using it anyway.
~ trewq
Reply
#5
(09-08-2010, 12:45 AM)Goilio Wrote:  Na, it should be fine people should know what you are talking about otherwise they shouldn't be using it anyway.

Heh, good point.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)