Ethan
06-12-2001, 02:44 PM
Hi Linux geniuses. I have two Linux boxes running -- "main" and "secondary". I'd like to write a shell script on secondary that will switch to a backups directory, and then
1. Run ftp and connect to "main"
2. get a file from there
3. compress the file and give it a name that includes the date and time
I'd like to make it a chron job so I can have automatic daily backups of a database.
If anyone can give suggest some code that would do this I'd be totally stoked. A little explanation would be helpful too, because I'm very new to shell scripting.
One thing about this that confuses me is what happens when you go into ftp. If you have a command in your script that says, "run ftp", then is the next command in your script interpreted by the shell or by ftp? Is there a way to say, "shell, chill, I'm talking to ftp"?
Thanks
Ethan
1. Run ftp and connect to "main"
2. get a file from there
3. compress the file and give it a name that includes the date and time
I'd like to make it a chron job so I can have automatic daily backups of a database.
If anyone can give suggest some code that would do this I'd be totally stoked. A little explanation would be helpful too, because I'm very new to shell scripting.
One thing about this that confuses me is what happens when you go into ftp. If you have a command in your script that says, "run ftp", then is the next command in your script interpreted by the shell or by ftp? Is there a way to say, "shell, chill, I'm talking to ftp"?
Thanks
Ethan