Do, or do not. There is no ‘try’ |

CAT | Linux Docs

Aug/09

25

Use wget or curl to download from RapidShare Premium

September 15th, 2007 by George Notaras

The last days I needed to download a bunch of medical videos which have been uploaded to RapidShare by many other people. Although RapidShare (and all the other 1-click file-hosting services) is very convenient, it has some strict rules for free accounts, for example a guest has to wait for 120 seconds per 1 MB of downloaded data and – to make it worse – no download managers are allowed. Since “waiting” is not a game I like and since I intended to use either wget or curl to download the files, I decided to sign up for a RapidShare Premium account and then figure out how to use the aforementioned tools. Fortunately, registered users are permitted to use download managers and, as you will read in the following article, the Linux command line downloaders work flawlessly with a Premier account.
Theory

Rapidshare uses cookie-based authentication. This means that every time you log into the service, a cookie containing information which identifies you as a registered user is stored in your browser’s cookie cache. Both wget and curl support saving and loading cookies, so before using them to download any files, you should save such a cookie. Having done this, then the only required action in order download from RapidShare is to load the cookie, so that wget or curl can use it to authenticate you on the RapidShare server. This is pretty much the same you would do with a graphical download manager. The difference now is that you do it on the command line.

Below you will find examples about how to perform these actions using both wget and curl.

IMPORTANT: Please note that in order to use these command-line utilities or any other download managers with RapidShare, you will have to check the Direct Downloads option in your account’s options page.
Save your RapidShare Premium Account Cookie

Saving your RapidShare cookie is a procedure that needs to be done once.

The login page is located at:

https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi

The login form requires two fields: login and password. These are pretty self-explanatory.

In the following examples, the RapidShare username is shown as USERNAME and the password as PASSWORD.
Using wget

In order to save your cookie using wget, run the following:

wget \
–save-cookies ~/.cookies/rapidshare \
–post-data “login=USERNAME&password=PASSWORD” \
-O – \
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi \
> /dev/null

–save-cookies : Saves the cookie to a file called rapidshare under the ~/.cookies directory (let’s assume that you store your cookies there)
–post-data : is the POST payload of the request. In other words it contains the data you would enter in the login form.
-O – : downloads the HTML data to the standard output. Since the above command is run only in order to obtain the cookie, this option prints the HTML data to stdout (Standard Output) and then discards it by redirecting stdout to /dev/null. If you don’t do this, wget will save the HTML data in a file called premiumzone.cgi in the current directory. This is just the Rapidshare HTML page, which is absolutely not needed.
Using curl

In order to save your cookie using curl, run the following:

curl \
–cookie-jar ~/.cookies/rapidshare \
–data “login=USERNAME&password=PASSWORD” \
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi \
> /dev/null

–cookie-jar : Saves the cookie to a file called rapidshare under the ~/.cookies directory (it has been assumed previously that cookies are stored there)
–data : contains the data you would enter in the login form.
Curl prints the downloaded page data to stdout by default. This is discarded by sending it to /dev/null.
Download files using your RapidShare Premium Account Cookie

Having saved your cookie, downloading files from RapidShare is as easy as telling wget/curl to load the cookie everytime you use them to download a file.
Downloading with wget

In order to download a file with wget, run the following:

wget -c –load-cookies ~/.cookies/rapidshare

-c : this is used in order to resume downloading of the file if it already exists in the current directory and is incomplete.
–load-cookies : loads your cookie.
Downloading with curl

In the same manner, in order to download a file with curl, run the following:

curl -L -O –cookie ~/.cookies/rapidshare

-L : Follows all redirections until the final destination page is found. This switch is almost always required as curl won’t follow redirects by default (read about how to check the server http headers with curl).
-O : By using this switch you instruct curl to save the downloaded data to a file in the current directory. The filename of the remote file is used. This switch is also required or else curl will print the data to stdout, which is something you won’t probably like.
–cookie : loads your Rapidshare account’s cookie.
Setting up a Download Server

Although most users would be satisfied with the above, I wouldn’t be surprised if you would want to go a bit further and try to setup a little service for your downloading pleasure. Here is a very primitive implementation of such a service. All you will need is standard command line tools.

This primitive server consists of the following:

1. A named pipe, called “dlbasket“. You will feed the server with URLs through this pipe. Another approach would be to use a listening TCP socket with NetCat.
2. A script, which, among others, contains the main server loop. This loop reads one URL at a time from dlbasket and starts a wget/curl process in order to download the file. If dlbasket is empty, the server should just stay there waiting.

So, in short, the service would be the following:

cat <> dlbasket | ( while … done )

All credit for the “cat <> dlbasket |” magic goes to Zart, who kindly helped me out at the #fedora IRC channel.

So, let’s create that service. The following assume that a user named “downloader” exists in the system and the home directory is /var/lib/downloader/. Of course you can set this up as you like, but make sure you adjust the following commands and the script’s configuration options accordingly.

First, create the named pipe:

mkfifo -m 0700 /var/lib/downloader/dlbasket

If it does not exist, create a bin directory in the user’s home:

mkdir -p /var/lib/downloader/bin

Also, create a directory where the downloaded files will be saved:

mkdir -p /var/lib/downloader/downloads

The following is a quick and dirty script I wrote which actually implements the service. Save it as rsgetd.sh inside the user’s bin directory:

#! /usr/bin/env bash

# rsgetd.sh – Download Service

# Version 0.2

# Copyright (C) 2007 George Notaras (http://www.g-loaded.eu/)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# Special thanks to ‘Zart’ from the #fedora channel on FreeNode

# CONFIG START
HOMEDIR=”/var/lib/downloader”
DLBASKET=”$HOMEDIR/dlbasket”
DLDIR=”$HOMEDIR/downloads/”
LOGFILE=”$HOMEDIR/.downloads_log”
CACHEFILE=”$HOMEDIR/.downloads_cache”
LIMIT=”25k”
WGETBIN=”/usr/bin/wget”
# Rapidshare Login Cookie
RSCOOKIE=”$HOMEDIR/cookies/.rapidshare”
# CONFIG END

DATETIME=”`date ‘+%Y-%m-%d %H:%M:%S’`”

cat <> $DLBASKET | (
while read url ; do
# First, check the cache if the file has been already downloaded
if [ -f "$CACHEFILE" -a -n $(grep -i $(basename $url) "$CACHEFILE") ] ; then
echo “$DATETIME File exists in cache. Already downloaded – Skipping: $url” >> $LOGFILE
else
echo “$DATETIME Starting with rate $LIMIT/s: $url” >> $LOGFILE
if [ $(expr match "$url" '[rapidshare.com]‘) = 1 ] ; then
# If it is a Rapidshare.com link, load the RS cookie
echo “RAPIDSHARE LINK”
$WGETBIN -c –limit-rate=$LIMIT –directory-prefix=$DLDIR –load-cookies $RSCOOKIE $url
else
$WGETBIN -c –limit-rate=$LIMIT –directory-prefix=$DLDIR $url
fi
echo “$DATETIME Finished: $url” >> $LOGFILE
echo $url >> $CACHEFILE
fi
done )

exit 0

As you might have already noticed, two extra files are created inside the home directory: .downloads_cache and .downloads_log. The first contains a list of all the urls that have been downloaded. Each new download is checked against this list, so that the particular URL is not processed if the file has already been downloaded. The latter file is a usual logfile stating the start and end times of each download. Feel free to adjust the script to your needs.

Here is some info about how you should start the service:

-1- You can simply start the script as a background process and then feed URLs to it. For example:

rsgetd.sh &
echo “” > /var/lib/downloader/dlbasket

-2- Use screen in order to run the script in the background but still be able to see its output by connecting to a screen session. Although this is not a screen howto, here is an example:

Create a new screen session and attach to it:

screen -S rs_downloads

While being in the session, run rsgetd.sh

rsgetd.sh

From another terminal feed the download basket (dlbasket) with urls:

echo “” > /var/lib/downloader/dlbasket
cat url_list.txt > /var/lib/downloader/dlbasket

Watch the files in the screen window as they are being downloaded.

Detach from the screen session by hitting the following:

Ctrl-a d

Re-attach to the session by running:

screen -r

Note that you do not need to be attached to the screen session in order to add URLs.
Feeding the basket with URLs remotely

Assuming that a SSH server is running on the machine that runs rsgetd.sh, you can feed URLs to it by running the following from a remote machine:

ssh downloader@server.example.org cat \> /var/lib/downloader/dlbasket

Note that the > needs to be escaped so that it is considered as part of the command that will be executed on the remote server.

Now, feel free to add as many URLs as you like. After you hit the [Enter] key the url will be added to the download queue. When you are finished, just press Ctrl-D to end the URL submission.
Conclusion

This article provides all the information you need in order to use wget or curl to download files from your RapidShare Premium account. Also, information on how to set up a service that will assist you in order to commence downloads on your home server from a remote location has been covered.

The same information applies in all cases that wget and curl need to be used with websites that use cookie-based authentication.

source: http://www.g-loaded.eu/2007/09/15/use-wget-or-curl-to-download-from-rapidshare-premium/

No tags

Nov/08

24

Wget

# You have a file that contains the URLs you want to download? Use the `-i’ switch:

wget -i file

If you specify `-’ as file name, the URLs will be read from standard input.

# Create a five levels deep mirror image of the GNU web site, with the same directory structure the original has, with only one try per document, saving the log of the activities to `gnulog’:

wget -r http://www.gnu.org/ -o gnulog

# The same as the above, but convert the links in the HTML files to point to local files, so you can view the documents off-line:

wget –convert-links -r http://www.gnu.org/ -o gnulog

# Retrieve only one HTML page, but make sure that all the elements needed for the page to be displayed, such as inline images and external style sheets, are also downloaded. Also make sure the downloaded page references the downloaded links.

wget -p –convert-links http://www.server.com/dir/page.html

The HTML page will be saved to `www.server.com/dir/page.html’, and the images, stylesheets, etc., somewhere under `www.server.com/’, depending on where they were on the remote server.

# The same as the above, but without the `www.server.com/’ directory. In fact, I don’t want to have all those random server directories anyway–just save all those files under a `download/’ subdirectory of the current directory.

wget -p –convert-links -nH -nd -Pdownload \

http://www.server.com/dir/page.html

# Retrieve the index.html of `www.lycos.com’, showing the original server headers:

wget -S http://www.lycos.com/

# Save the server headers with the file, perhaps for post-processing.

wget -s http://www.lycos.com/
more index.html

# Retrieve the first two levels of `wuarchive.wustl.edu’, saving them to `/tmp’.

wget -r -l2 -P/tmp ftp://wuarchive.wustl.edu/

# You want to download all the GIFs from a directory on an HTTP server. You tried `wget http://www.server.com/dir/*.gif’, but that didn’t work because HTTP retrieval does not support globbing. In that case, use:

wget -r -l1 –no-parent -A.gif http://www.server.com/dir/

More verbose, but the effect is the same. `-r -l1′ means to retrieve recursively (see section 3. Recursive Retrieval), with maximum depth of 1. `–no-parent’ means that references to the parent directory are ignored (see section 4.3 Directory-Based Limits), and `-A.gif’ means to download only the GIF files. `-A “*.gif”‘ would have worked too.

# Suppose you were in the middle of downloading, when Wget was interrupted. Now you do not want to clobber the files already present. It would be:

wget -nc -r http://www.gnu.org/

# If you want to encode your own username and password to HTTP or FTP, use the appropriate URL syntax (see section 2.1 URL Format).

wget ftp://hniksic:mypassword@unix.server.com/.emacs

Note, however, that this usage is not advisable on multi-user systems because it reveals your password to anyone who looks at the output of ps.

# You would like the output documents to go to standard output instead of to files?

wget -O – http://jagor.srce.hr/ http://www.srce.hr/

You can also combine the two options and make pipelines to retrieve the documents from remote hotlists:

wget -O – http://cool.list.com/ | wget –force-html -i -

————————————–

Basics
Wget is one of the powerful tools available there to download stuff from internet. You can do a lot of things using wget. Basic use is to download files from internet.

To download a file just type

wget http://your-url-to/file

But you cannot resume broken downloads.use -c option to start resumable downloads

wget -c http://your-link-to/file

You can also mask the program as web browser using -U.
This helps when the sites doesn’t allow download managers.

wget -c -U Mozilla http://your-link-to/file

Return To Contents

Download Entire Website
You can download an entire website using -r option.

wget -r http://your-site.com

But be careful. It downloads the entire website for you. Since this tool can put a large load on servers it obeys robot.txt you can mirror a site on you local drive using -m option.

wget -m http://your-site.com

You can select the levels up to which you can dig into the site and downloads using -l option.

wget -r -l3 http://your-site.com

This will download only up to 3 levels. Suppose you want download only sub folders in a website url use –no-parent option. With this option wget downloads only the sub folders and ignores,the parent folders

wget -r –no-parent http://your-site.com/subfldr/subfolder

Now coming to terrible ideas.. to the hell with webmasters, not allowing to download the website type to ignore the robots.txt.

wget -r -U Mozilla -erobots=off http://url-to-site/

p.s. masking like a browser is a crime in some countries…. or something like that, i have heard on net.

Return To Contents

Fooling the Webmasters
Do you think the web master cannot stop u with above command. to fool him use

wget -r -U Mozilla -erobots=off -w 5 –limit-rate=20 http://url-to-site/

here -w 5 instructs wget to wait 5 secs before downloading another file and –limit-rate=20 makes wget to cap the download speed to 20KBps. So u can fool the webmaster ….

Return To Contents

Download all PDFs
You can download all files of a particular format , like all pdfs listed on a webpage,

wget -r -l1 -A.pdf –no-parent http://url-to-webpage-with-pdfs/

This is most useful for students. When they find a webpage of a professor with the files they can use this command to download all pdfs or lecture notes.
————————————————————————————————————————

Let wget working after log out from ssh connection

I usually connect through ssh to my office (better ADSL than my home’s) and download the files there over the night, the next day I bring them home.

So, to make wget continue working after the log out, because I do not want to let my home PC on all night long, so the command is:

wget -b http://some.server.com/file
Logging the output to a file

This is useful when you are working with wget in the background, to be able to know what was wrong if anything goes wrong, use the -o option and specify a file to store the logs.

wget http://some.server.com/file -o $HOME/log.txt

Of course you can combine the options, and put something like this:

wget -b -c http://some.server.com/file –limit-rate=20K -o $HOME/log.txt

No tags

Virtual hosting allows you to host multiple websites, accessed by unique domain names, from the same IP address (same server). I use this technique on my web server to host multiple websites for myself and a few others. Setting up virtual hosting is not difficult, and can be done with a stock Ubuntu 8.04 server installation and multiple domain names.

What you’ll need:

* Configured Server: Install and configure Ubuntu Server 8 at least to the specifications mentioned in my installation and domain name configuration tutorials. You must have command line access to the server (physical or via ssh).
* Domain Names: In order for virtual hosting to be effective, you obviously need more than one domain name. If you do not own multiple domains, you can create sub-domains (”sub.domain.com”). This can be done in your Namecheap domain manager on the Domain Registration page. You can modify the sub-domains once you create them on the All Host Records Page. When a new domain or sub-domain is added, it will take up to two days to process before it can be accessed. Note: All sub-domains will have the same Dynamic DNS password as their parent domain.

Server Configuration:

* Setup User Accounts: Each of the virtual sites that you setup will have an author with a user account on the server. These users must have access to a home directory to store their website. The user can then transfer files to and from the server via SSH/SFTP (look for a FTP server tutorial in the future). To setup these accounts, type the following into the server command line, replacing newuser with the desired username of the web author, and password with the desired initial password of the web author:

sudo useradd newuser -d /home/newuser

sudo mkdir /home/newuser

sudo passwd newuser password

sudo chown newuser /home/newuser

Repeat this for each website (with related author) you plan to add to your server. Provide the new user with the password you just created for them, and instruct them to change it when they login (SSH) by typing passwd into the server command line.
* Setup Site Directory: In my installation tutorial, we moved the web directory for the server’s default website to /home/yourusername/www. This is fine for a simple, single-website server, but since we will be setting up new virtual sites anyway, we might as well set up an organized website directory structure. Your web directory should consist of three parts, a documents folder where your pages are stored, a cgi-bin folder where your cgi scripts are stored, and a logs folder where your access and error logs are stored. Since you will have different sites with different owners, replicate this structure in the home folder of each site’s author. To do this, type the following into the server command line, replacing username with the username of the web author:

sudo mkdir /home/username/htdocs

sudo chown username /home/username/htdocs

sudo mkdir /home/username/cgi-bin

sudo chown username /home/username/cgi-bin

sudo mkdir /home/username/logs

sudo chown username /home/username/logs

Repeat this for each web author. Note: If you already have an established website for yourself in /home/yourusername/www folder such as mentioned in my installation tutorial, just rename the folder to “htdocs”. Type the following into the server command line, replacing yourusername with your username:

sudo mv /home/yourusername/www /home/yourusername/htdocs

* Enable Virtual Hosting:The first step to setting up virtual hosting is to enable virtual hosts in Apache. This is done by creating a virtual hosts configuration file. Type the following into the server command line:

sudo nano /etc/apache2/conf.d/virtual.conf

Add the following line to the new file:

NameVirtualHost *

Press ctrl+x to quit, y to save changes, then enter to confirm.
* Setup Virtual Sites: Apache makes managing multiple virtual sites easy with its modular structure. It stores each sites configuration file in the /etc/apache2/sites-available/ directory, and allows the administrator to enable or disable them individually with a single command. First, we need to disable and delete the configuration for the default site. Type the following into the server command line:

sudo a2dissite default

sudo /etc/init.d/apache2 reload

sudo rm /etc/apache2/sites-available/default

Now that the default site is gone, create a virtual site for each web author. Type the following into the server command line, replacing sub.domain.com with the [sub]domain name of your site:

sudo nano /etc/apache2/sites-available/sub.domain.com

Now paste the following into the new file, replacing the italicized portions with the appropriate values discussed previously:

#
# sub.domain.com (/etc/apache2/sites-available/sub.domain.com)
#

ServerAdmin youremailaddress
ServerName sub.domain.com
ServerAlias sub.domain.com

# Indexes + Directory Root.
DirectoryIndex index.html index.htm index.php
DocumentRoot /home/authorsusername/htdocs/
# CGI Directory
ScriptAlias /cgi-bin/ /home/authorsusername/cgi-bin/

Options +ExecCGI

# Logfiles
ErrorLog /home/authorsusername/logs/error.log
CustomLog /home/authorsusername/logs/access.log combined

Press ctrl+x to quit, y to save changes, then enter to confirm. Repeat this step for each virtual website.
* Enable site: Now that you have setup your virtual websites, all that is left to do is enable them. Enable each virtual website, one at a time by typing the following into the server command line, replacing sub.domain.com with the names of sites you added in the previous step:

sudo a2ensite sub.domain.com

Note: you can disable a site by typing the similar command into the server command line:

sudo a2dissite sub.domain.com

That’s it! Now, just restart the Apache server and your sites should be online. Type the following into the server command line:

sudo /etc/init.d/apache2 reload

Now you can access separate websites on the same server via unique [sub]domain names. Please comment with any suggestions or additions to these instructions.

from: http://www.corey-m.com/blog/?p=315

No tags

DESCRIPTION

The file freshclam.conf configures the Clam AntiVirus Database Updater,
freshclam(1).
The file consists of comments and options with arguments. Each line
that starts with a hash (#) symbol is a comment. Options and arguments
are case sensitive and of the form Option Argument. The (possibly
optional) arguments are of the following types:

STRING String without blank characters.

SIZE Size in bytes. You can use ’M’ or ’m’ modifiers for megabytes
and ’K’ or ’k’ for kilobytes.

NUMBER Unsigned integer.

DIRECTIVES

When an option is not used (hashed or doesn’t exist in the configura‐
tion file) freshclam takes a default action.

Example
If this option is set freshclam will not run.

DatabaseOwner STRING
When started by root, drop privileges to a specified user.
Default:

AllowSupplementaryGroups
Initialize supplementary group access (freshclam must be started
by root).
Default: disabled

DatabaseDirectory STRING
Path to a directory containing database files.
Default: /var/lib/clamav/

Checks NUM
Number of database checks per day.
Default: 12

UpdateLogFile STRING
Enable logging to a specified file. Highly recommended.
Default: disabled.

LogSyslog
Enable logging to Syslog. May be used in combination with
UpdateLogFile.
Default: disabled.

LogFacility
Specify the type of syslog messages – please refer to ’man sys‐
log’ for facility names.
Default: LOG_LOCAL6

PidFile
This option allows you to save the process identifier of the
daemon.
Default: disabled

LogVerbose
Enable verbose logging.
Default: disabled

DNSDatabaseInfo STRING
This directive enables database and software version verifica‐
tion through DNS TXT records.
Default: enabled, pointing to current.cvd.clamav.net

DatabaseMirror STRING
Server name where database updates are downloaded from. In order
to download the database from the closest mirror you should con‐
figure freshclam to use db.xy.clamav.net where xy represents
your country code. If this option is given multiple times,
freshclam(1) tries them in the order given. It’s strongly recom‐
mended that you use db.xy.clamav.net as the first mirror and
database.clamav.net as the second.
Default: database.clamav.net

MaxAttempts NUM
Freshclam(1) tries every mirror this number of times before
switching to the next mirror.
Default: 3 (per mirror)

HTTPProxyServer STR, HTTPProxyPort NUM
Use given proxy server and TCP port for database downloads.

HTTPProxyUsername STR,HTTPProxyPassword STR
Proxy usage is authenticated through given username and pass‐
word.
Default: no proxy authentication

LocalIPAddress IP
Use IP as client address for downloading databases. Useful for
multi homed systems.
Default: Use OS´es default outgoing IP address.

NotifyClamd [STRING]
Notify a running clamd(8) to reload its database after a down‐
load has occurred. Optionally a clamd.conf(5) file location may
be given to tell freshclam(1) how to communicate with clamd(8).
Default: The default is to not notify clamd. See clamd.conf(5)´s
option SelfCheck for how clamd(8) handles database updates in
this case.

OnUpdateExecute STRING
Execute this command after the database has been successfully
updated.
Default: disabled

OnErrorExecute STRING
Execute this command after a database update has failed.
Default: disabled

NOTE

While not reasonable, any configuration option from clamd.conf(5) may
be given.

FILES

/etc/clamav/freshclam.conf
AUTHOR
Lamy,T,. freshclam.conf – Configuration file for Clam AntiVirus Database Updater, Available from:
< http://manpages.ubuntu.com/manpages/dapper/man5/freshclam.conf.html> [02/11/2008/]
Clam AV nuts and bolts
To install Clam Antivirus:

sudo apt-get install clamav
(Providing that your /etc/apt/sources.list file is up to date, you will get a good recent version of Clam antivirus installed on your machine.)

To update your virus definitions:

freshclam

To check files in your home directory:

clamscan

To check files in the entire home directory:

clamscan -r /home

To check files on the entire drive (displaying everything):

clamscan -r /

To check files on the entire drive but only display infected files and ring a bell when found:

clamscan -r –bell –mbox -i /

Run Clam AV from a terminal window!

Why would you run an antivirus scan on an Ubuntu Linux Hoary computer. At this time, the only reason is if you transfer files back and forth to a Windows machine or transfer/serve email. There are yet no known virus/worm/trojan/root-violation problems with properly set-up Ubuntu computers. However, if you use a Hoary distribution as a computer to transfer files from one location to another, they originate/end up on Windows machines, or if you want to scan a network.. this can be useful.

Here is a sample readout from: clamscan -r –bell –mbox -i /home

Quote:
clamscan -r –bell –mbox -i /home
(infected file would be listed here)

———– SCAN SUMMARY ———–
Known viruses: 33840
Scanned directories: 145
Scanned files: 226
Infected files: 1
Data scanned: 54.22 MB
I/O buffer size: 131072 bytes
Time: 20.831 sec (0 m 20 s)
Here is a sample readout from freshclam :
Quote:
root@ubuntu4:/etc/clamav # freshclam
ClamAV update process started at Wed Apr 27 00:06:47 2005
main.cvd is up to date (version: 31, sigs: 33079, f-level: 4, builder: tkojm)
daily.cvd is up to date (version: 855, sigs: 714, f-level: 4, builder: ccordes)
To find out what version you have:
Quote:
root@ubuntu4:/etc/clamav # clamscan -V
ClamAV 0.83/855/Tue Apr 26 06:40:32 2005
You can use the –remove flag (clamscan –remove) too automatically remove virus-infected files, but it is not recommended it. Sometimes, clam AV will figure a file is a virus when it is not. Thus, I look at the results and make a decision whether a file should be removed.

For learning about more flags for clamscan, try man clamscan or info clamscan

You can use the at command to schedule clamscan and/or freshclam.
For example:
at 3:30 tomorrow
at>freshclam
at>
job 3 at 2005-04-28 03:30
(You have scheduled and confirmed that the Clam AV update will occur at 3:30 AM tomorrow.

crazybill; April 27th, 2005

http://ubuntuforums.org/showthread.php?t=30060

No tags

In order to write DVD/DVD-RW from shell prompt you need to install a package called dvd+rw-tools.

DVD is another good option for backup, archiving, data exchange etc. You can install dvd+rw-tools with following commands. Also note that this package works under *BSD, HP-UX, Solaris and other UNIX like operating systems.

Debian installation:
# apt-get install ‘dvd+rw-tools’

Fedora Core Linux installation:
# yum install ‘dvd+rw-tools’

RedHat Enterprise Linux installation:
# up2date ‘dvd+rw-tools’

First create the ISO image
# mkisofs -r -o /tmp/data.iso /home/data

Now use the growisofs command to write the ISO onto the DVD:
# growisofs -Z /dev/dvd=/tmp/var-www-disk1.iso

To append more data for same DVD:
# growisofs -M /dev/dvd /tmp/file.1

To format (erase) a DVD:
# dvd+rw-format -force /dev/dvd
OR
# dvd+rw-format -force=full /dev/dvd

The dvd+rw-format command formats dvd disk in the specified dvd drive.

To display information about dvd drive and disk using dvd+rw-mediainfo command:
# dvd+rw-mediainfo /dev/dvd

No tags

Older posts >>

Designed by devolux