Cheapest Webhosting in India

Hello All,

Found a common problem with Ubuntu 9.10

Failed to execute child process “testparm” (No such file or directory).

Solution:

sudo apt-get upgrade samba-common-bin

Cheerss :) 

How backup files from remote Linux server

We want to backup files from remote server called srv.pankajdangi.com and directory called /home/pankaj to local directory called /var/www/backup, type the command as follows on local system:

$ rsync -avz -e ssh pankaj@srv.pankajdangi.com:/home/pankaj/ /var/www/backup

You need to supply password for pankaj user.
Done.

Automatic backup using a shell script

SSH always prompts for a password. To automate process via a shell script you need to remove password using SSH key.
Run command at local system.

$ ssh-keygen -t dsa
When asked for to enter passphrase, just press [ENTER] key twice. Now copy public key to remote server:
$ scp ~/.ssh/id_dsa.pub pankaj@srv.pankaj.com:.ssh/authorized_keys
Now you can login without a password.

Now create a simple shell script as follows:
$ vi /var/www/backup.sh
Append code:
#!/bin/bash
rsync -avz -e ssh pankaj@srv.pankajdangi.com:/home/pankaj/ /var/www/backup

Setup executable permission using chmod command:
$ chmod +x backup.sh

Use cron to command to backup remote server:
$ crontab -e
Make a backup everyday:
0 5 * * * /path/to/backup.sh [It will run everyday at 5]

Done
Cheers

Transfer file from remote to local pc

Use the following command from the server to which you want the files to go.
In this example, transfer all files (/var/www/html) from remote server called server1 to local directory called /backup:

scp -r user@server1:/var/www/html/ /backup

************************************************************************************************

Transfer file with SCP from remote to other remote server

In the following example, transfer all files (/var/www/html) from remote server called server1 to another server called server2:
scp -r user@server1:/var/www/html/ user@server2:/var/www/html/