2

Hi there I'm new here in the forum and very new using tools for Linux. Actually I'm tasked to learn about wget. I already know a few though I'm trying to find out if there is a syntax to use to schedule the start and stop time of the copying or downloading, please help thanks!

1
  • What are you going to do? wget doesn't have a scheduling mechanism. – A.B. Jul 14 '15 at 5:03
1

wget itself doesn't have scheduling properties, but as you are using Linux then you probably have to take a look for cron.

Cron is a time-based job scheduler in Linux, used to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.

To add a job to cron scheduler as normal user run the command:

crontab -e

else if you want to schedule a job for root:

sudo crontab -e

Linux Crontab Format

MIN HOUR DOM MON DOW CMD

Field      Description       Allowed Value

MIN        Minute field        0 to 59
HOUR       Hour field          0 to 23
DOM        Day of Month        1-31
MON        Month field         1-12
DOW        Day Of Week         0-6
CMD        Command             Any command to be executed.

For example:

Run the wget in a specific time let's say in 15july 8:20 AM

then the cron entry would be like:

20 08 15 07 * wget URL://

Take a look at:

Now by the time you want to stop wget you have also to add another cron entry using pkill command: let's say I want to stop wget at 15july 10:30 PM then add this entry to cron:

30 22 15 07 * pkill wget

To resume again a broken wget download, you can use the -c or --continue option in wget.

wget -c URL://
wget --continue URL://

man wget

-c
   --continue
       Continue getting a partially-downloaded file.  This is useful when
       you want to finish up a download started by a previous instance of
       Wget, or by another program.
7
  • Now how would you stop wget? – muru Jul 14 '15 at 6:59
  • use pkill in cron to kill wget – Maythux Jul 14 '15 at 7:01
  • Add that to the answer and complete it! Also mention how you can continue downloads using wget. – muru Jul 14 '15 at 7:02
  • So Why downvoting?! – Maythux Jul 14 '15 at 7:05
  • @muru ok i'll edit the answer adding the needed info – Maythux Jul 14 '15 at 7:06
0

The usual linux/unix way to do this would be to use another system utility to schedule wget activity: cron.

See

man 5 crontab
man cron

and

man crontab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.