Ask Your Question

How to create a batch file to list the shortcut of all items in different folders

asked 2014-10-04 10:00:24 -0500

debraj gravatar image

Suppose I have a folder, A, containing folders, B1, B2, ... Now each of these Bi 's contain items Bi1, Bi2, ... . We have to create a folder, D, which contains the shortcuts to all Bij.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-06 11:17:01 -0500

jonn gravatar image

Hi - if you wanted to solve this using Puppet, you'd probably need to have some way to discover the items (Bij) on the server via some route - perhaps a custom fact. Or alternatively, perhaps you could manage the folders B1, B2 and items Bi1, Bi2 etc with Puppet as well? If so, then you could store those pathnames in hiera where they would be readily available to you.

You could then create a shortcut to each one using a puppet file resource:

file { "/path/to/D/Bxy":
   ensure => link,
   target => "/path/to/Bx/Bxy",

However unless there is a particular reason to manage these links via Puppet, then it might be less hassle to call a script to discover the files and create the shortcuts in one go. You could still call this script via Puppet using an exec resource.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-04 10:00:24 -0500

Seen: 345 times

Last updated: Oct 06 '14