Tag Archives: Linux

rsync – Sync with delete

Previously i wrote a post about how to limit the bandwidth during an rsync operation.

 

Another parameter which you could alter is whether you want to delete the extra files in the destination folder.

rsync --delete -v -e ssh /home/ykyuen/* ykyuen@remote-server:/home/ykyuen/

 

Done =)

Reference: Juan Valencia’s website – Synchronizing folders with rsync

Yum – Check for update of repositories

When a new rpm is added to a yum repository server, the cache in the client machine makes the new rpm unreachable. To check for update of repositories, run the following command in the client.

  • yum clean expire-cache

 

Then you can try to search for your new rpm by

  • yum list <new rpm package>

 

Done =)

Reference: How do I get yum to see updates to a local repo without cleaning cache?

Linux – Re-sign an rpm package

Working on the Puppet manifest to install the newrelic-sysmond package to all the nodes. I want to host the newrelic-sysmond.rpm on the company repository server but in that case the i have to re-sign the rpm.

What i need to do is to download the rpm from the New Relic repository, move it to the RPM build server and run the following command.

  • rpm --resign newrelic-sysmond-1.3.1.437-1.x86_64.rpm

 

You will be prompted to enter the passphrase and that’s it.

Done =)

Reference: Maximum RPM – Signing Packages

Linux – Limit the bandwidth for rsync

We can use the --bwlimit to limit the bandwidth being used by the rsync command. Here is an example which transfer the local files to a remote server using ssh+rysnc.

rsync --bwlimit=100 -v -e ssh /home/ykyuen/* ykyuen@remote-server:/home/ykyuen/

 

The bandwidth is limited to 100kb/s.

Done =)

Reference:

Linux – Wait until a specific pattern is written on log using tail and sed

In the Ant build.xml, i need to make sure the JBoss server is started before running the test cases. There are 2 possible approaches.

  • Using twiddle.sh to check the status
  • Monitoring server.log until “Started in” is written on it

 

I took the 2nd approach. Here is an example output log when the JBoss server is started successfully.
Continue reading