Find the answer to your Linux question:
Results 1 to 2 of 2
Hello everyone! Now I am new to Linux and am just starting to get firmilar with my Ubuntu 7.04 server. The more I use it the more I like it ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    2

    Exclamation Need Help with making Mysql and ftp automated backups

    Hello everyone!
    Now I am new to Linux and am just starting to get firmilar with my Ubuntu 7.04 server. The more I use it the more I like it and Linux in general! I used to have windows on that machine and I used it as a ftp/http/backup server. so far I have the Linux machine doing ftp/http and lan backups using samba.

    I have been trying to make a shell script that will run once a week and do the following:
    1. visit a url (to run a php script)
    2. Download a folder via ftp
    3. place it in a dir that has a date for it's name
    4. and if there is more than X# of these dirs delete the oldest

    Now I don't know much about shell scripts so I don't know if this is possible. If it is how would I accomplish the first one and the last two. (as I'm using wget for #2)

    Any help is much appreciated!

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    welcome to the forum

    I don't understand yr #1, but here's some ideas about #3 & #4:

    > 3. place it in a dir that has a date for it's name

    suppose we take the date of download as the name to use:

    mkdir `date +%D | sed 's/\//-/g'` gives a directory 05-24-07

    > 4. and if there is more than X# of these dirs delete the oldest

    suppose all and only our dated directories are in some directory D

    cd D; ls | sort | sed '1,X#d' | xargs rm -r
    the sun is new every day (heraclitus)

Posting Permissions

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