P
Peter Bailey
Hi,
I've got a bunch of scripts that suddenly appear to be dying on me. When
I run them in my Ruby editor, Aracho, they run fine. But, when they're
scheduled with a scheduler and run on their own every ten minutes or so,
they run the first part of the script, but then stop. Here's a simple
sample of one os these scripts. They're basically just conversion
scripts. They convert EPS or PDF files to two formats, TIFF and PNG,
and, once that's done, they copy and move those files to various places
on my network.
The script dies right after it finishes with line 5 here. All the files
created simply stay in the scratch directory and aren't moved or copied.
1 Dir.chdir("C:/prodalchemy/IM/scratch")
2 Dir.glob("*.eps").each do |epsfile|
3 Alchemy.tiff epsfile
4 Alchemy.png epsfile
5 end
6 Dir.chdir("C:/prodalchemy/IM/scratch")
7 #EPS Files
8 epsfiles = Dir.glob("*.eps")
9 epsfiles.each do |epsfile|
10 FileUtils.cp(epsfile, "E:/out2ps2k/print")
11 FileUtils.cp(epsfile, "E:/out2vax")
12 prefix = epsfile[/[A-z-]{1,6}/]
13 numerals = epsfile[/[0-9]{1,6}/]
14 epsdirectory = ""
15 if numerals.to_s.length == 6 then
16 prime = numerals[0,3]
17 epsdirectory = "//vigil/eps/#{prime}000"
18 elsif numerals.to_s.length == 5 then
19 prime = numerals[0,2]
20 epsdirectory = "//vigil/eps/#{prime}000"
21 elsif numerals.to_s.length == 4 then
22 prime = numerals[0,1]
23 epsdirectory = "//vigil/eps/0#{prime}000"
24 elsif numerals.to_s.length == 3 then
25 epsdirectory = "//vigil/eps/00000"
26 elsif numerals.to_s.length == 2 then
27 epsdirectory = "//vigil/eps/00000"
28 elsif numerals.to_s.length == 1 then
29 epsdirectory = "//vigil/eps/00000"
30 end
31 FileUtils.mv(epsfile, epsdirectory)
32 end
It repeats this "EPS" clause for PDF, TIFF, and PNG, too.
Thanks,
Peter
I've got a bunch of scripts that suddenly appear to be dying on me. When
I run them in my Ruby editor, Aracho, they run fine. But, when they're
scheduled with a scheduler and run on their own every ten minutes or so,
they run the first part of the script, but then stop. Here's a simple
sample of one os these scripts. They're basically just conversion
scripts. They convert EPS or PDF files to two formats, TIFF and PNG,
and, once that's done, they copy and move those files to various places
on my network.
The script dies right after it finishes with line 5 here. All the files
created simply stay in the scratch directory and aren't moved or copied.
1 Dir.chdir("C:/prodalchemy/IM/scratch")
2 Dir.glob("*.eps").each do |epsfile|
3 Alchemy.tiff epsfile
4 Alchemy.png epsfile
5 end
6 Dir.chdir("C:/prodalchemy/IM/scratch")
7 #EPS Files
8 epsfiles = Dir.glob("*.eps")
9 epsfiles.each do |epsfile|
10 FileUtils.cp(epsfile, "E:/out2ps2k/print")
11 FileUtils.cp(epsfile, "E:/out2vax")
12 prefix = epsfile[/[A-z-]{1,6}/]
13 numerals = epsfile[/[0-9]{1,6}/]
14 epsdirectory = ""
15 if numerals.to_s.length == 6 then
16 prime = numerals[0,3]
17 epsdirectory = "//vigil/eps/#{prime}000"
18 elsif numerals.to_s.length == 5 then
19 prime = numerals[0,2]
20 epsdirectory = "//vigil/eps/#{prime}000"
21 elsif numerals.to_s.length == 4 then
22 prime = numerals[0,1]
23 epsdirectory = "//vigil/eps/0#{prime}000"
24 elsif numerals.to_s.length == 3 then
25 epsdirectory = "//vigil/eps/00000"
26 elsif numerals.to_s.length == 2 then
27 epsdirectory = "//vigil/eps/00000"
28 elsif numerals.to_s.length == 1 then
29 epsdirectory = "//vigil/eps/00000"
30 end
31 FileUtils.mv(epsfile, epsdirectory)
32 end
It repeats this "EPS" clause for PDF, TIFF, and PNG, too.
Thanks,
Peter