| | |
Setting crontab to pull database
![]() |
•
•
Join Date: Jun 2008
Posts: 25
Reputation:
Solved Threads: 0
I'm working in a location with a physical server, and the company I am working for is in a different location, and has a cloud server with a different address.
Database backups work using automysqlbackup script in the cloud server also. But the database backups that I want to pull from the cloud server is quite huge and cannot be exported to my local server using phpMyAdmin.
So can I use the scp command in the crontab to pull the backed up database daily into my local server? , i.e :
Thanks.
Database backups work using automysqlbackup script in the cloud server also. But the database backups that I want to pull from the cloud server is quite huge and cannot be exported to my local server using phpMyAdmin.
So can I use the scp command in the crontab to pull the backed up database daily into my local server? , i.e :
Thanks.
•
•
Join Date: Sep 2009
Posts: 26
Reputation:
Solved Threads: 2
0
#2 Oct 28th, 2009
Not sure if the cron environment or the crontab itself will support the use of scp in that shell the way you want to use it. I'd suggest pulling the scp command out into some script file and then running the script, after you explicitly set any required or assumed environment variables. Something like:
where /path/to/script.sh is your new script and inside it, you have:
* * * * * /path/to/script.sh
#!/bin/bash export ENVIRONMENT_VAR=foo #whatever else you need scp -r root@cloudservername:/backups/databasename.sql.gz > /tmp/output.log
![]() |
Similar Threads
- Student Database Design (Database Design)
- help needed..setting up network xp:vista (Networking Hardware Configuration)
- convert date(string) to date (date time) (JavaScript / DHTML / AJAX)
- Oracle Service Problem (Oracle)
- Calculation in FormView part 2 (ASP.NET)
- Online application (PHP)
- online music library 22222 (PHP)
- dead integrated video (Troubleshooting Dead Machines)
Other Threads in the *nix Software Forum
- Previous Thread: Cron job problems
- Next Thread: cron job not running for big time intervals
Views: 661 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for *nix Software
2005 apache bashscripting busybox cert codeplex debian dotnetnuke emacs forwarding free fsf gaming gnu government gpl lawsuits license linux ls mail make makefile mandriva microsoft mkisofsiso obama open opensource port postfix ps3 samba security server sflc sharing software source stallman subdirectory ubuntu unix vmware xbox





