Filed Under (linux) by admin on 18-01-2012
Here we will use the find -mtime and xargs commands
Complete script:
find '/home/user/data/' -name '*.txt' -mtime +7 | xargs rm
Explanation:
find -mtime displays files made based on given number of days
find '/home/user/data/' -name '*.txt' -mtime +7
xargs captures the result of a previous command and pass it as an argument for another function
find '/home/user/data/' -name '*.txt' -mtime +7 | xargs rm
The result of the find command is passed to another function rm which then removes the files
Filed Under (linux) by admin on 14-11-2011
Tagged Under : ubuntu
Check if your laptop is fully compatible with ubuntu
http://www.ubuntu.com/certification/
Filed Under (linux) by admin on 14-04-2011
Automate the deploy of your project on svn commit, this require you have access to your svn server
On your server got to your repo folder
/usr/local/svn/my_repo
———————————————————————–
then go to hooks folder
/usr/local/svn/my_repo/hooks
———————————————————————–
then copy the post-commit.tpl to post-commit
cp post-commit.tpl post-commit
the post-commit file is a file called by subversion after every commit, basically its a bash script
———————————————————————–
chmod the post-commit file
chmod +x post-commit
———————————————————————–
Now lets edit the post-commit file.
Lets say your project dev directory resides on the same server, the post-commit file has content so we erase them all and add this
#!bin/usr/bash
cd /home/dev_website
svn up .
what the bash does is change directory to the /home/dev_website then execute the svn update command
———————————————————————————————————————————————–
and were done, next time there is no need to log in to the server just to svn update of your dev website.
Filed Under (linux) by admin on 02-12-2009
Command to generate a decent random password
openssl rand -base64 6