1

I have a few php files on my server that I created and I'd like to download them to this computer for backup purposes. Is there an easy way to do this? (I'm connected to my server via SSH).

Also, are there any programs out there that can periodically source control or back up my webroot directory on my server automatically?

4 Answers 4

5

You can cron an rsync job to periodically sync it.

You can use the SSH FUSE module to mount the remote directory as a directory on your system and cron a copy or rsync to do it.

You can cron an SFTP or SCP script to periodically copy it over.

Those are a few things that come to mind off the top of my head that would work for limited purposes of a small backup.

I'd consider having a cron job on the server that tars and compresses the files you want to a special subdirectory, appending a date to the filename, and then syncing that to your local system just to keep track of some "snapshots" of the files in question.

2
  • +1 for automating the process Jul 27, 2011 at 12:36
  • Glad I could help, @Vadoff. Jul 27, 2011 at 12:59
4

scp is the way to go in that case.

Here are some examples on how to use scp.

here is an example to download a file called myphp.php located in the /tmp folder and save it locally to your /tmp folder

scp your_username@your_server:/tmp/myphp.php /tmp

If you are using a windows machine locally you can use winSCP...

1

You can also have a look at Unison: http://www.cis.upenn.edu/~bcpierce/unison/

With Unison it is easy to have two replicas of files (it's not unidirectional, meaning that changes in A will propagate to B and changes in B will be propagated to A) and can be executed unattended. Another nice thing is that it'll only send the files that have changed, which is important if you have to transmit a lot of files or MB.

0

Use scp to downlaod files via ssh.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .