Thursday, January 31, 2013

Eclipse helios Classpath Dependency Validater Messages


While using eclipse helios, when you come across Classpath Dependency Validater Messages such as Description Resource Path Location Type Classpath entry /Test/libs/xxx.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. ChatTest P/Test Classpath Dependency Validator Message

Then you can overcome this by doing following operation
 Properties --> Deployment Assembly add --> Java Build path Enteries --> xxx.jar--> finish

Wednesday, March 21, 2012

Deleting Older Backup Files in a Folder in a Linux machine

In one of my tasks, I had to maintain a weekly backup of the database and at the same time, was also asked to clear the backup files that were older than 2 months.

To perform this task i followed the following procedure

1) To perform this kind of task,cronjob( a linux utility ) is needed.
cronjob:cronjob is like a scheduler, that automatically performs the give task, at the specified intervals.
Ex: to perform weekly backup , we write backup script and then supply it to the cronjob, with a schedule of 7 days. cronjob automatically runs the script every 7 days

2)The command for backing up the database is
mysqldump --host=hostname --user=username --password=password dbname > dumpfilename.sql

It is written in perl script as:

#!/bin/sh

#############
# Shell Script to backup the database
#############
#finding todays date and assign to dumpfilename
$dumpfilename=
system("mysqldump --host=hostname --user=username --password=password dbname > $dumpfilename.sql");


3)
To delete older backup files, I used modified time as a parameter to delete the older files.
the command for deleting files that are older that 2 days is

find /home/user/yourpath/ -mtime +2 -type f -exec rm -rf {} \;
Or
rm -f `find ./testfolder -mtime +2 -type f`

perl script for it is:

#!/bin/sh
###############################################
## Shell script for deletion
###############################################
##declaring variables
$A_LOG_PATH=~/opt/yourpath/
$PAST=60
system(" rm -f \`find $A_LOG_PATH -mtime +$PAST -type f\` ");

4)Now these 2 perl files are specified in the crontab with a schdule of 7 days for backup.pl and 60 days for deletebckup.pl

Thus,the task was completed.

Tuesday, January 24, 2012

CSS float

In CSS by using float,elements flow horizontally i.e left or right.

It is mostly used along with images to flow towards left or right.

It can also be used to create next and previous buttons on a page, fitting to any resolution. This is better than other methods used to represent the next and prev buttons like
the tables or
using 2 buttons and space between them.
The above 2 methods are good but with change in resolution or browser, they get overlapped or so..

example:




*****************************some text goes here**************************





This effect can be generated with float, also we can play with images also