Results 1 to 6 of 6

Thread: bash scripting

  1. #1
    Join Date
    Jan 2013
    Beans
    3

    bash scripting

    Hi, Ubuntu users.

    I'm having a problem in bash scripting. I want to download .gr2 files in ftp server, and place the downloaded files in $DocumentRoot/directories/directories and organize the file system image according to date. can anyone know the script ?

  2. #2
    Join Date
    Nov 2007
    Location
    Wisconsin
    Beans
    998

    Re: bash scripting

    see man wget

  3. #3
    Join Date
    Jan 2013
    Beans
    3

    Re: bash scripting

    oh thanks. wget then URL right ? how about the script on how to organize the file system according to its date ?

  4. #4
    Join Date
    Nov 2007
    Location
    Wisconsin
    Beans
    998

    Re: bash scripting

    By "organize the file system image according to date," I assume you mean "set the last-modified date on the downloaded file."

    wget can do that. See the 'timestamping' section of the wget man page.

    You can separately change a file's date anytime using the touch command. See http://askubuntu.com/questions/62492...ated-of-a-file
    Last edited by Cheesehead; January 29th, 2013 at 03:57 AM.

  5. #5
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    870
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: bash scripting

    If you mean "create directory base/year/month/day/", you can use date to get the date. Read man date for precise instructions. You can store year, month and day in bash variables and then use wget with the option
    Code:
    wget --directory-prefix=$DocumentRoot/$year/$month/$day

  6. #6
    Join Date
    Jan 2013
    Beans
    3

    Re: bash scripting

    thank you, thank you it helped me a lot.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •