{"id":2474,"date":"2017-12-08T11:21:56","date_gmt":"2017-12-08T11:21:56","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2474"},"modified":"2025-02-01T23:08:04","modified_gmt":"2025-02-01T23:08:04","slug":"creating-file-system-info-and-put-into-mysql-db","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/creating-file-system-info-and-put-into-mysql-db\/","title":{"rendered":"Creating file system info and put into mysql db"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Creating file system info and put into mysql db<\/strong><\/p>\n<p>Create a perl script for following task\u2026<br \/>\n1. Read the directory mentioned by users and list all the files along with their size and Create a property file which has following info of each file.<\/p>\n<p>#\tServer name\tPath\tFile Name\tdate\tSize<br \/>\n1\trajesh\t\/perforce\/server:port\/root\txyz.txt\ttoday\t10KB<\/p>\n<p>2. Insert this data into mysql Db in table in same fashion as it is in property file<\/p>\n<p>Regards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>rajeshkumar replied the topic: Re: Creating file system info and put into mysql db<\/strong><\/p>\n<p>Hi Tushar,<\/p>\n<p>I could make it for reading directory and displaying files in such a given format&#8230;<\/p>\n<p>My example program is<\/p>\n<p>$DIR = &#8220;\/home\/rajesh&#8221;;<\/p>\n<p>@dirlist = `ls -l $DIR | tr -s &#8221; &#8221; &#8221; &#8220;| cut -d &#8221; &#8221; -f5,9`;<br \/>\nforeach (@dirlist)<br \/>\n{<br \/>\nprint &#8220;$_ \\n&#8221;;<br \/>\n}<\/p>\n<p>Regards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rajeshkumar created the topic: Creating file system info and put into mysql db Create a perl script for following task\u2026 1. Read the directory mentioned by users and list all the files along with their size and Create a property file which has following info of each file. # Server name Path File Name date&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[14],"tags":[493],"class_list":["post-2474","post","type-post","status-publish","format-standard","hentry","category-perl","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2474"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2474\/revisions"}],"predecessor-version":[{"id":2475,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2474\/revisions\/2475"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}