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 ...
- 05-21-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 2
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:
- visit a url (to run a php script)
- Download a folder via ftp
- place it in a dir that has a date for it's name
- 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!
- 05-28-2007 #2Linux 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 -rthe sun is new every day (heraclitus)


Reply With Quote