Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

The TechSucks TechBlog - blog.crash-override.net

Why technology sucks, and some just sucks less. The view and opinion of an experienced user.

Search:

Archives | Tags | esden | daja77 | Kendo Bilder

[] Verifying mysqldump output the quick-n-dirty way RSS feed for section Tech

Inspired by a recent blog post over at LGP I wrote this little bash function to verify if a dump command has written the correct data to the filesystem:

blindcoder@fortuna:~$ type mysqldump
mysqldump is a function
mysqldump ()
{
filename="`readlink /proc/${$}/fd/1`";
exec > "`readlink /proc/${$}/fd/0`";
executable="";
for path in ${PATH//:/ };
do
[ -x "${path}/mysqldump" ] && executable="${path}/mysqldump";
done;
"${executable}" "${@}" | tee "${filename}" | md5sum;
md5sum "${filename}"
}
blindcoder@fortuna:~$ mysqldump -u root -p blindcoder_gurps > /tmp/gurps.sql
Enter password:
47726f328affa7a8a2f1db8a172b8c70 -
47726f328affa7a8a2f1db8a172b8c70 /tmp/gurps.sql


EOF

Back home  clock 09:23:15 31.03.2009 | Permalink | Trackback URI

Leave a comment

Allowed HTML tags: a abbr acronym b blockquote em li ol p strong sub sup u ul

Name


Link (enter mailto:you@address.com for mailaddress, otherwise http:// is implied)


Comment