Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acqua
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LAGO
Software
Acqua
Commits
2f84d419
Commit
2f84d419
authored
9 years ago
by
Hernán Asorey
Browse files
Options
Downloads
Patches
Plain Diff
Include automatic data transfer
parent
5a812993
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brc/lago/lago-configs.pl
+47
-26
47 additions, 26 deletions
brc/lago/lago-configs.pl
brc/lago/lago-trfs.sh
+8
-0
8 additions, 0 deletions
brc/lago/lago-trfs.sh
with
55 additions
and
26 deletions
brc/lago/lago-configs.pl
+
47
−
26
View file @
2f84d419
...
...
@@ -56,7 +56,7 @@
@parameters
=
();
# Parameters
# If you need to add more question, just add them in four rows:
# If you need to add more question
s
, just add them in four rows:
# 1) Parameter Id
# 2) Question you need to ask to user
# 3) Number(1), string(0), bool(2) parameter?
...
...
@@ -249,7 +249,7 @@ push @parameters,
2
,
"
n
",
# SENSORS 168-19
3
# SENSORS 168-19
5
"
hasGPS
",
"
Is GPS module installed (y/n)
",
2
,
...
...
@@ -277,7 +277,25 @@ push @parameters,
"
racimo
",
"
Is this a RACIMO station
",
2
,
"
n
";
"
n
",
# TRANSFER 196-211
"
autoTransfer
",
"
Should I automatically transfer data to the central repository?
",
2
,
"
y
",
"
hourInterval
",
"
Time interval in hours between two sucesive transfers trials (if 24, once per day at 05h50m local time)
",
1
,
24
,
"
remoteUser
",
"
User name at central repository?
",
0
,
"",
"
remoteIP
",
"
IP of the central repository (remote)
",
0
,
"
200.16.117.76
";
sub
get
{
my
$question
=
$_
[
0
];
...
...
@@ -520,6 +538,12 @@ $blockN=4; # SENSORS
$block
=
"
# BLOCK
\t\t
SENSORS
";
ask
(
168
,
193
,
$block
,
$blockN
);
print
"
$parameters
[196]
";
$blockN
=
5
;
# TRANSFER
$block
=
"
# BLOCK
\t\t
DATA TRANSFER
";
ask
(
196
,
211
,
$block
,
$blockN
);
# not asking values (backward compatibility)
$now
=
time
;
print
$fh
"
work=
\"
$configs
{
$parameters
[0]}
\"\n
";
...
...
@@ -531,32 +555,27 @@ cmd("mv lago-configs-tmp lago-configs");
# now, modify crontab.run
$bash
=
`
which bash
`;
chomp
(
$bash
);
# hours to transfer
$trf
=
"
# # END OF LAGO CRONTAB
";
$hour
=
"
5
";
if
(
$configs
{"
autoTransfer
"})
{
$itr
=
$configs
{"
hourInterval
"};
if
(
$itr
==
1
)
{
$hour
=
"
*
";
}
elsif
(
$itr
>
1
&&
$itr
<
24
)
{
$hour
=
"
*/
$itr
";
}
$trf
=
"
50
$hour
* * *
$bash
-ic
$configs
{
$parameters
[0]}/lago-trfs.sh >>
$configs
{
$parameters
[0]}/lago-daq.log 2>&1
# # END OF LAGO CRONTAB
";
}
open
(
$fh
,
"
> crontab.run
")
or
die
"
# ERROR:
\t\t
Can't open crontab.run: $!
\n
";
print
$fh
"
# Edit this file to introduce tasks to be run by cron.
# #
# # Each task to run has to be defined through a single line
# # indicating with different fields when the task will be run
# # and what command to run for the task
# #
# # To define the time you can provide concrete values for
# # minute (m), hour (h), day of month (dom), month (mon),
# # and day of week (dow) or use '*' in these fields (for 'any').#
# # Notice that tasks will be started based on the cron's system
# # daemon's notion of time and timezones.
# #
# # Output of the crontab jobs (including errors) is sent through
# # email to the user the crontab file belongs to (unless redirected).
# #
# # For example, you can run a backup of all your user accounts
# # at 5 a.m every week with:
# # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# #
# # For more information see the manual pages of crontab(5) and cron(8)
# #
# # m h dom mon dow command
print
$fh
"
# # CRONTAB AUTOMATICALLY GENERATED BY LAGO ACQUA
# # PLEASE DON'T MODIFY
*/5 * * * *
$bash
-ic
$configs
{
$parameters
[0]}/lago-start.sh >
$configs
{
$parameters
[0]}/lago-daq.log 2>&1
10 * * * *
$bash
-ic
$configs
{
$parameters
[0]}/lago-proc.sh
# eventually some rsync.sh to transfer files to the repository
$trf
";
close
(
$fh
);
...
...
@@ -584,6 +603,8 @@ print $fh "# Edit this file to introduce tasks to be run by cron.
# # For more information see the manual pages of crontab(5) and cron(8)
# #
# # m h dom mon dow command
10 * * * *
$bash
-ic
$configs
{
$parameters
[0]}/lago-proc.sh
$trf
";
close
(
$fh
);
...
...
This diff is collapsed.
Click to expand it.
brc/lago/lago-trfs.sh
0 → 100755
+
8
−
0
View file @
2f84d419
#!/bin/bash
source
${
LAGO_DAQ
}
/lago-configs
cd
${
work
}
datadir
=
${
work
}
if
(
$hasUSB
)
;
then
datadir
=
${
usb
}
fi
rsync
-aPv
$datadir
/
*
.bz2
${
remoteUser
}
@
${
remoteIP
}
:~/lago/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment