[HOW TO] rsync copy Directories Structures

Hello,

My name Tien.
I just finished to sync directories structures on SLES 11 (Linux). I think, i should share this job to everybody.

Firstly you need to install rsync on all source and destination. The differences between two sets of files accross the network connection, using an efficient checksum-search algorithm. Make sure it's installed on all server for remote copy.

Syntax:

rsync -av -f"+ */" -f"- *" /path/to/src /path/to/dest/
rsync -av -f"+ */" -f"- *" /path/to/src user@ip/domain:/path/to/dest/

If you are using an older rsync version, try:

rsync -av --include='*/' --exclude='*' /path/to/src /path/to/dest/
rsync -av --include='*/' --exclude='*' /path/to/src user@ip/domain:/path/to/dest/

References: http://www.cyberciti.biz/faq/unix-linux-bsdosx-copying-directory-structures-trees-rsync/




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

[WHAT] Java location?

matteo@matteo-ThinkPad-SL:~$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6.31-oracle/bin/java     1062      manual mode

Press enter to keep the current choice[*], or type selection number:




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

[HOW TO] solve 'The following packages have unmet dependencies' error?

Try :
sudo apt-get update
sudo apt-get -f install

----------------

if didn't work then give us the contents of /etc/apt/sources.list

  • One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren’t installed properly. To fix this problem, hit Alt+Ctrl+T to open terminal and try to run one of the following commands:
    sudo apt-get clean
    or,
    sudo apt-get autoclean
    apt-get clean clears out the local repository of retrieved package files (the .deb files). It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. apt-get autoclean clears out the local repository of retrieved package files, but unlike apt-get clean, it only removes package files that can no longer be downloaded, and are largely useless.
  • One of the most basic fixes to resolve dependencies problems is to run:
    sudo apt-get -f install
    The -f hare stands for “fix broken”. Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.
    Then run:
    sudo dpkg --configure -a
    Then run this again:
    sudo apt-get -f install
    If the output is:
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    That means it failed.
  • Next solution is to run:
    sudo apt-get -u dist-upgrade
    If it shows any held packages, it is best to eliminate them. Packages are held because of dependency conflicts that apt cannot resolve. Try this command to find and repair the conflicts:
    sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
    If it cannot fix the conflicts, it will exit with:
    0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
    Delete the held packages one by one, running dist-upgrade each time, until there are no more held packages. Then reinstall any needed packages. Be sure to use the --dry-run option, so that you are fully informed of consequences:
    sudo apt-get remove --dry-run package-name
    Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the packages you need to satisfy the dependencies.
Finally, if all else fails, you can attempt to satisfy the dependencies yourself, either by finding and installing the necessary packages, or by installing them from source and then creating “deb” packages for them.
Source: http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success