script for taking screenshot of all folders...

Asked by sanyprashant on 2010-10-30

hi all,

i want to write a script to take screenshot of all folders and files inside a drive...
including folders inside folders....
                      i know a command to take screenshot (import -window root Screenshot.png).....
but i am not getting how do i use it to take screenshot of all folders inside a drive.
basically its a looping...but i cant figure it out...

thanks in advance...

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Last query:
2010-10-31
Last reply:
2010-10-31

Why do you need this? Seems a little excessive.

sanyprashant (sanyprashant) said : #2

actually my all software files are currupted (around 90gb) due to virus.so i want to download it again in future,thats why i need screenshot....
              i just want a script that will browse through all folders...

Why not just use text instead of images?

sanyprashant (sanyprashant) said : #4

images gives quick information about files and folders...
as data is 90gb..using tree(stores in text) command,it is not possible.
thats why i need to have screenshot

Isn't there a script to go to each and every folder?

anyways thanks for your reply

sanyprashant (sanyprashant) said : #5

images gives quick information about files and folders...
as data is 90gb..using tree(stores in text) command,it is not possible.
thats why i need to have screenshot

Isn't there a script to go to each and every folder?

anyways thanks for your reply

sanyprashant (sanyprashant) said : #6

sorry my browser hanged at that time..

your 90Gb of data could be 2 files of 45Gb so file use space is fairly moot

you can but bash is a bit of a messy way (but possible). I suggest you post on a bash forum to get better help. I came up with this:

#!/bin/bash
mkdir ~/result
count="0"
for i in `find /start/folder -type d`
  nautilus "$i"
  import -window root "~/result/screenshot-$count.png"
  count+=1
done

sanyprashant (sanyprashant) said : #8

i tried a lot options...but not working...

thanks...i will try it

sanyprashant (sanyprashant) said : #9

what does this mean "nautilus "$i" "

sanyprashant (sanyprashant) said : #10

it gives me error
syntax error near unexpected token `nautilus'
 nautilus "$i"'

thats just something I bashed out (pun intended), you will be using something like that

$i means 'the content of the variable i'

Can you help with this problem?

Provide an answer of your own, or ask sanyprashant for more information if necessary.

To post a message you must log in.