I have a backup sync program on local server. I have an ssh password less login set up, and I can run commands on an external server in bash script doing:
How do I run multiple commands in bash on a remote Unix or Linux server? What is the best Way to SSH in and Run various unix commands in bash?
There are various ways to run multiple commands on a remote Unix server. The syntax is as follows:
Simple bash syntax to run multiple commands on remote machine
Simply run command2 if command1 successful on a remote host called foo $ ssh bar@foo "command1 && command2" Run date and hostname commands: $ ssh user@host "date && hostname" You can run sudo command as follows on a remote box called server1.cyberciti.biz: $ ssh -t vivek@server1.dbsysnet.com "sudo /sbin/shutdown -h now" And, finally: $ ssh root@server1.dbsysnet.com "sync && sync && /sbin/shutdown -h now"
What is a « locale » on a Linux operating system? How do I set or get locals (i18n) values on a Linux operating system?
Locales defines language and country specific setting for your programs and shell session. You can use locales to see date, time, number, currency and other values formatted as per your country or language on a Linux or Unix-like system.
To set system’s locale you need use shell variable. For example, LANG variable can be used to set en_US (English US) language.
How do I show current locale settings on a Linux or Unix?
rsync is used to perform the backup operation in UNIX / Linux.
rsync utility is used to synchronize the files and directories from one location to another in an effective way. Backup location could be on local server or on remote server.
Important features of rsync
Speed: First time, rsync replicates the whole content between the source and destination directories. Next time, rsync transfers only the changed blocks or bytes to the destination location, which makes the transfer really fast.
Security: rsync allows encryption of data using ssh protocol during transfer.
Less Bandwidth: rsync uses compression and decompression of data block by block at the sending and receiving end respectively. So the bandwidth used by rsync will be always less compared to other file transfer protocols.
Privileges: No special privileges are required to install and execute rsync
Syntax
$ rsync options source destination
Source and destination could be either local or remote. In case of remote, specify the login name, remote server name and location. Lire la suite…
Rsync (Remote Sync) is a most commonly used command for copying and synchronizing files and directories remotely as well as locally in Linux/Unix systems. With the help of rsync command you can copy and synchronize your data remotely and locally across directories, across disks and networks, perform data backups and mirroring between two Linux machines.
This article explains 10 basic and advanced usage of the rsync command to transfer your files remotely and locally in Linux based machines. You don’t need to be root user to run rsync command.
Some advantages and features of Rsync command
It efficiently copies and sync files to or from a remote system.
Supports copying links, devices, owners, groups and permissions.
It’s faster than scp (Secure Copy) because rsync uses remote-update protocol which allows to transfer just the differences between two sets of files. First time, it copies the whole content of a file or a directory from source to destination but from next time, it copies only the changed blocks and bytes to the destination.
Rsync consumes less bandwidth as it uses compression and decompression method while sending and receiving data both ends.