[HowTo] Backup Your Files And Upload To HotFile Or Rapidshare

There are lots of file server services on the internet. You can host your files for free. The biggest 2 are Rapidshare and Hotfile. They both offer free service to host your files. And Hotfile offers an affiliate program where you can earn money per 1000 downloaded files. But for now I will talk about backing up your files using Rapidshare or Hotfile.

I got this script from WJunction, and I feel it is a great script to share with you. This is a free script developed by the community. All the rights belong to the respective owner and community.

Copy this script:

#!/bin/bash
if [ $# -ne 2 ]
then
  size=$((100 * 1024))
else
  size=$(($2 * 1024))
fi
  file=$1
  rarfile=${file%.*}_your-site.com.${file##*.}.rar
  rar a -m0 -v"$size"k $rarfile $1
  echo $rarfile >> rarNupload.log

if [ $2 ]; then
part=1
while [ $part -le 10 ]
do
    if [ -f ${file%.*}_your-site.com.${file##*.}.part$part.rar ];
    then
       echo "Uploading" ${file%.*}_your-site.com.${file##*.}.part$part.rar "to RS"
        perl rsapiresume.pl ${file%.*}_your-site.com.${file##*.}.part$part.rar col rsUserName rsPassword
       echo "Uploading" ${file%.*}_your-site.com.${file##*.}.part$part.rar "to HF"
        curl -T ${file%.*}_your-site.com.${file##*.}.part$part.rar ftp.hotfile.com --user hfUserName:hfpassword
        rm ${file%.*}_your-site.com.${file##*.}.part$part.rar
    else
       echo "File $FILE does not exists"
    fi
part=`expr $part + 1`
done
else
  echo "Uploading" $rarfile "to RS"
    perl rsapiresume.pl $rarfile col rsUserName rsPassword
  echo "Uploading" $rarfile "to HF"
    curl -T $rarfile ftp.hotfile.com --user HFUsername:hfpassword
  rm $rarfile
fi

Save it as uploadFileRapidHotfile.sh

Or download the script

Changes to be made throughout the whole script

your-site.com: your hostname
rsUserName: your Rapidshare username
rsPassword: your Rapidshare password
hfUserName: your Hotfile username
hfPassword: your Hotfile password

How to use the script:

./uploadFileRapidHotfile.sh "file to be compressed" "Number of MB"

“file to be compressed”: path to the file name. Only works with 1 file at a time.
“Number of MB”: File size to be split in MB.