Author Topic: script downloading files in the newest version  (Read 822 times)

Offline siamer

  • Sr. Member
  • ****
  • Posts: 284
    • ZEN-mini
script downloading files in the newest version
« on: August 06, 2011, 09:26:49 AM »
Hi.

I'm not good with script so I have question for you. Can someone tell me how should look script to download some packages. Let say that I want download 5 files (just example) from http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/:
Quote
allegro-4.4.1.1-1pclos2010.src.rpm
almanah-0.7.3-3pclos2010.src.rpm 
amule-2.2.6-3pclos2011.src.rpm
android-notifier-desktop-0.5.1-1pclos2010.src.rpm
anthy-9100h-1pclos2010.src.rpm

but I want always downlaod  them in the newest version so script can't have specific verion (mean if will be almanah in version 0.7.4 than I want it). want download them to: /home/siamer/Download/

any idea how to do that ?

Regards,
siamer
Every man dies, but not every man really lives... !!

   

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: script downloading files in the newest version
« Reply #1 on: August 06, 2011, 01:45:00 PM »
Simple for the first part.

Code: [Select]
#!/bin/bash
wget -c http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/allegro-4.4.1.1-1pclos2010.src.rpm http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/almanah-0.7.3-3pclos2010.src.rpm http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/amule-2.2.6-3pclos2011.src.rpm http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/android-notifier-desktop-0.5.1-1pclos2010.src.rpm http://ftp.heanet.ie/pub/pclinuxos/apt/pclinuxos/2010/SRPMS.updates/anthy-9100h-1pclos2010.src.rpm

make it executable (chmod a+x). For the latest version... no idea. :)
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: script downloading files in the newest version
« Reply #2 on: August 07, 2011, 05:18:33 AM »
Have you tried using a wildcard (like "*") in place of the version number?

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10621
  • MLUs Forever!
Re: script downloading files in the newest version
« Reply #3 on: August 07, 2011, 05:23:40 AM »
Maybe use rsync in the script?
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT