mit shell script und diff dateien prüfen
25. August 2010
Kommentare deaktiviert für mit shell script und diff dateien prüfen By webpirat
Um durch etwaige Cronjobs eine Prüfung von 2 Dateien und darauf folgende Aktionen zu erzeugen, kann ein shell script Verwendung finden.
#!/bin/bash SOURCE=/mount/data/new_file.txt TARGET=/srv/www/vhosts/www/app/config/old_file.txt diff -i -b -B -q ${SOURCE} ${TARGET} if [ ! $? -eq 0 ] then echo "new file is different from old one - copy new one to old" cp ${SOURCE} ${TARGET} else echo "no difference between files - nothing to do" fi
Neueste Beiträge
Kategorien
- Agavi
- Android
- ANT
- Apache
- Bildbearbeitung
- CMS Systeme
- Codeigniter
- CSS
- Debugging
- Deployment
- Doctrine ORM
- Flash
- Frameworks
- GIT
- Javascript
- Kanban
- Kohana
- Layout & Styles
- Lightroom
- Lighttpd
- Linux
- Management & Prozesse
- MySQL
- Nginx
- OffTopic
- Photographie
- Photoshop
- PHP
- PhpMyAdmin
- PHPUnit
- Postfix
- Propel ORM
- Ruby On Rails
- Scrum
- Server
- Shell
- Sicherheit
- SOAP
- Social Media
- Sonata
- SVN
- Symfony2
- Versionierung
- VIM
- Wordpress
- XDebug
- XML
- XT Commerce
- Zend