Syntax error last token seen t garbled time

Linux scheduler: Cron, At jobs Published: November 22, 2016 | Modified: June 24, 2020 Learn everything about Linux/Unix schedulers i.e. cron and at. Know how to schedule cronjobs and at jobs, their configuration files, log files. Unix or Linux comes with native in-build job scheduler i.e. cron and at . Out of which cron […]

Содержание

  1. Linux scheduler: Cron, At jobs
  2. Configurations
  3. Syntax
  4. Crontab commands
  5. Cron logs
  6. Configurations
  7. Syntax
  8. Thread: Garbled time?
  9. Garbled time?
  10. xCAT Bugs
  11. An extreme cluster/cloud administration toolkit
  12. Milestone
  13. Searches
  14. #3173 2.8:run xcatconfig -m have error with perl-IO-Socket-INET6 installed
  15. Scheduling Jobs Using at Command in Linux
  16. Commands used with at:
  17. 1. Schedule a Job Using ‘at’ Command
  18. 2. List the scheduled jobs using atq
  19. 3. Remove scheduled job using atrm
  20. 4. Check the content of scheduled at job
  21. Examples of at Command:
  22. Related Posts
  23. Sed Command in Linux with 15 Practical Examples
  24. lsusb Command in Linux (Display USB device Details)
  25. 12 Apt Command Examples in Ubuntu & Debian Linux
  26. 29 Comments

Linux scheduler: Cron, At jobs

Published: November 22, 2016 | Modified: June 24, 2020

Learn everything about Linux/Unix schedulers i.e. cron and at. Know how to schedule cronjobs and at jobs, their configuration files, log files.

Unix or Linux comes with native in-build job scheduler i.e. cron and at . Out of which cron used to schedule tasks to repeat over some period while at used to execute the job at a specific time one time.

Cron enables administrators/users to execute a particular script or command at a given time of choice repetitively. It’s a daemon that runs in the background whenever system clock configured time it executes respective script or command. It can be checked if running with ps/service command.

Configurations

Cron saves commands/scripts and related schedules in a file called crontab . Normally crontab can be found in path /var/spool/cron and file with a username (root user crontab file can be seen in the below example). These are plain text files that can be viewed using cat , more commands and can be edited using a text editor.

But, it’s not advisable to edit crontab file with a text editor, you need to use crontab -e command to edit it so that syntax can be verified before saving. This command opens a crontab file in a native text editor only.

Cron access can be given a user basis. The administrator can enable or disable cron access to a particular user. There are two files cron.allow , cron.deny ; either one of which will exist on the server. These are files with usernames only. No special file format/syntax follows within. If both files are missing then the only superuser is allowed to use cron.

If cron.allow exists on the server then only users specified in this file are allowed to use cron, rest all are denied. And if it exists and empty then all are denied.

If cron.deny exists then only users specified in it are not allowed to use cron, rest all are allowed. And if it exists and empty then all are allowed.

Syntax

Let’s see the syntax for the crontab file and commands.

A crontab file has 6 fields separated by space to be filled in. Those are as below :

  • Minute: Timestamp in 24 hrs format
  • Hours: Timestamp in 24 hrs format
  • Day of month: Date in dd format
  • Month: Month number in mm format or Jan, Feb format.
  • Day of week: Numeric/text day of the week. 0 or 7 being Sunday or Sun, Mon, etc.

These fields also support a series of values or multiple values example 1,2,3 or 1-4. When multiple time values defined then the event will happen whenever the clock hits one of the values.

Default cron definitions i.e. path or shell used to execute commands/scripts in crontabs etc are defined in /etc/crontab file. See example below :

Crontab commands

We have a crontab command with several options to play around configurations.

  • -u Specify user
  • -l to view specified user’s crontab
  • -e to edit specified user’s crontab
  • -r to remove specified user’s crontab
  • -i Interactive removal. Should be used with -r

If a new crontab is being set then the system will show using empty crontab for the user!

Cron logs

All activities by cron daemon are logged in logfile /var/log/cron . It includes crontab alterations and cron daemon executions. Let’s look at the file

In the above example, you can see, crontab alteration is being logged with what actions took place. Those logs are against the crontab field where first braces show the user who did alterations and last braces show which user’s crontab was altered. In the last two, you can see cron commands being executed by cron daemon according to schedule hence logged against CROND . This file is very helpful in troubleshooting issues related to cron executions.

At enables administrators/users to execute a particular script or command at a given time of choice only once. It can also be termed as one-time task scheduling. Same as crond , a daemon for at is atd which runs in background. This can be checked using ps or service commands.

Configurations

at stores submitted jobs in files located at /var/spool/at where file names are system generated and unlike crontabs these files can not be read.

at access also can be given a user basis. It also has at.allow and at.deny files and those works same as cron.allow and cron.deny files we saw earlier in this post.

Syntax

at command should be supplied with the time you prefer to execute the command. Once given in proper format, it will present you with a prompt. This prompt takes command inputs that need to be executed at a given time. Once finished entering commands/ scripts one can simply press ctrl+d to exit out of at prompt and save the job. Observe a new file that is being generated at the above-mentioned path once you submit the job. at commands takes numerous types of time formats like noon, midnight, now + 2 hours, now + 20 minutes, tomorrow, next Monday, etc. If you enter the wrong format it will return the “garbled time” error message.

To view currently queued jobs in at scheduler run atq or at -l command. It shows the output with numbering in the first column. The second field is about a time when the execution will happen and the last field is the username.

To remove a particular job from queue atrm command is used. It should be supplied with serial number of the job. In the below example, we removed job number 2. You can see its vanished from the queue. The same can be achieved using at -r command instead of atrm .

at logs:

at daemon is very much regressive in terms of logging. Normally it does not log anything anywhere about its job queue alterations or job executions. Only fatal errors related to daemon are logged in Syslog only. Even if we turn debugging on, it logs information which is merely informative to look at.

Источник

Thread: Garbled time?

Thread Tools
Display

Garbled time?

When I use the at command it says «Garbled time».
Can anybody give me a hint what to do?

Thanx

Yes. Give the at command a time

at lets you run something at a specified time, like:

echo «foo» | at 10:00

would run the command «foo» at 10:00

at is actually quite verstatile about the time formats it takes. Not to tell you to RTFM or anything, but the manpage actually explains all the different time arguments at can take. It’s fairly intelligent. you can do stuff like «2:45PM Tomorrow», and it understands things like «midnight», «noon», and in most versions, «teatime» (whose time equivalent is unknown to me because I’ve never been a big fan of formalized tea-drinking, but I’m sure it’s in the manpage).

Well, actually i tried
at -f /usr/bin/hello +1 minutes
where hello is a script typing «Hello» on the screen (I’m a genius, I know )

But when I typed the command i got:
parse error. Last token seen: +
Garbled time
and I thought there was something wrong with my system clock or something.

Same error. Any solution?

Don’t have a Linux box handy right now to check the manpage but I think.
at -f /usr/bin/hello now + 1 minutes might do the job.

Источник

xCAT Bugs

Milestone

Searches

#3173 2.8:run xcatconfig -m have error with perl-IO-Socket-INET6 installed

when i first manually run xcatconfig -m on MN:
following error will occur

# xcatconfig -m
Can’t call method «delEntries» on an undefined value at /opt/xcat/sbin/chtab line 93.
syntax error. Last token seen: /
Garbled time
sh: -c: line 2: syntax error near unexpected token (‘ sh: -c: line 2: Prototype mismatch: sub Net::DNS::Resolver::Base::AF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66.’
Command failed: /opt/xcat/sbin/chtab -d node=Constant subroutine Net::DNS::Resolver::Base::AF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Prototype mismatch: sub Net::DNS::Resolver::Base::AF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Constant subroutine Net::DNS::Resolver::Base::PF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Prototype mismatch: sub Net::DNS::Resolver::Base::PF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Invalid nodes in noderange:__mgmtnode nodelist; 2>&1. Error message: .

Could not run /opt/xcat/sbin/chtab -d node=Constant subroutine Net::DNS::Resolver::Base::AF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Prototype mismatch: sub Net::DNS::Resolver::Base::AF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Constant subroutine Net::DNS::Resolver::Base::PF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Prototype mismatch: sub Net::DNS::Resolver::Base::PF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66.
at /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Net/DNS/Resolver/Base.pm line 65
Invalid nodes in noderange:__mgmtnode nodelist;.

error would gone after removing perl-IO-Socket-INET6.However,one error still remains with generating MN defination while running again.

# rpm -qa|grep perl-IO-S
perl-IO-Socket-SSL-1.38-5.2.2
perl-IO-Socket-INET6-2.56-3.10.2.1
x3250m4n02:

# rpm -e perl-IO-Socket-INET6-2.56-3.10.2.1
x3250m4n02:

# xcatconfig -m
Can’t call method «delEntries» on an undefined value at /opt/xcat/sbin/chtab line 93.
x3250m4n02:

# lsdef -o x3250m4n02
Object name: x3250m4n02
groups=__mgmtnode
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles

Источник

Scheduling Jobs Using at Command in Linux

While working with Linux systems we preferred crontab for scheduling jobs generally. There are another utility at command is very useful for scheduling one time tasks. It reads commands from standard input or script/file which can be executed later once. But we can’t use at command for any recurring tasks. For recurring tasks use Linux crontab.

At command can be useful for shutdown system at the specified time, Taking a one-time backup, sending an email as a reminder at the specified time, etc. This article will help you to understand the working of at command with useful examples.

Commands used with at:

  • at : execute commands at specified time.
  • atq : lists the pending jobs of users.
  • atrm : delete jobs by their job number.

1. Schedule a Job Using ‘at’ Command

The below example will schedule the backup.sh command to be executed at 9:00AM once.

Use ^d to exit from at prompt.
You can also use the following option to schedule a job. The below command will run the backup.sh script at 9:00 in the morning.

2. List the scheduled jobs using atq

When we list jobs by root account using atq , it shows all user’s jobs in the result. But if we execute it from a non-root account, it will show only that user’s jobs.

Fields description:
First filed: job id
Second filed: Job execution date
third filed: Job execution time
Last field: User name, under which job is scheduled.

3. Remove scheduled job using atrm

You can remove any job using atrm with their job id.

4. Check the content of scheduled at job

The atq command only shows the list of jobs but if you want to check what script/commands are scheduled with that task, the below example will help you.

In the above example, 5 is the job id.

Examples of at Command:

  1. Schedule task at coming 10:00 AM.
  2. Schedule task at 10:00 AM on coming Sunday.
  3. Schedule task at 10:00 AM on coming 25’th July.
  4. Schedule task at 10:00 AM on coming 22’nd June 2015.
  5. Schedule task at 10:00 AM on the same date as next month.
  6. Schedule task at 10:00 AM tomorrow.
  7. Schedule task at 10:00 AM tomorrow.
  8. Schedule task to execute just after 1 hour.
  9. Schedule task to execute just after 30 minutes.
  10. Schedule tasks to execute just after 1 and 2 weeks.
  11. Schedule tasks to execute just after 1 and 2 years.
  12. Schedule tasks to execute at midnight.

The above job will execute at 12:00 AM

Thanks for reading this article, I hope you will understand how to use the ‘at’ command in Linux.

Sed Command in Linux with 15 Practical Examples

lsusb Command in Linux (Display USB device Details)

12 Apt Command Examples in Ubuntu & Debian Linux

EXACTLY WHAT I NEEDED.
BTW the recaptcha input is underneath the Submit button in the comments form. Hard to click.

Thanks Khay, I hope recaptcha positioned correctly now.

Hi,
does it generate log after execution like cron ?

How can we schedule a gtk “graphical” job, for example a simple yad message?
yad –title “Warning” –text “Alarm now, attention” –on-top –borders=25

In my tests, no display is shown at a specified time.

How is it better to schedule installation of upgrades?
For some reason tasks don’t execute. I tried something like: sudo apt-get upgrade -y | at 21:00

It should be
echo “apt-get upgrade -y” | sudo at 21:00

how can we Schedule one job at two different timing with single command

touch helloworld.txt | at now + 1 minute | at now + 2 hours

Where do I see the output ? How will I know if the job has been executed or not ?

please tell me that i want to run a corntab command in every last day of the month.
i am thinking but in some its 30 days and 31 in some and 28 and 29 like that.

You can try cron like this:

here [ “$(date +%d -d tomorrow)” = “01” ] will retrun true if tomorrow is the first day of next month.

I’m using at to run mplayer and stream some radio station, when i want to stop mplayer and use atrm command it doesn’t work. i got only ” Warning: deleting running job” . job vanishes from the atq list, but it still streams music.

HI, I am experiencing an issue. When i am using the format:
command | at time

It is not executing the command that I am providing.
Please tell how to get past it.

echo “command” | at time

Great article Rahul!
I just wanted to extend it a bit with some useful additions.
1) You can use -f option to point “at” to the script you need to run:
at -f /path/to/the/script time_spec
2) One can use “at” to start a process in background without nohup, etc. As easy as
at -f /a/command now
or
echo “/a/command” | at now
3) You can use “at” to run a command repeatedly, but unlike cron you can use “at” to run commands with some period between runs, for example after 3 minutes after previous run was completed. This allow you to avoid various checks preventing next run to start before previous is finished.
Moreover you can define this period as random value. Examples:
The script (lets name it /home/user1/at_run.sh):
————————————-
#!/bin/bash
/the/command/you/need
# fixed period between runs
period=3
# or random period. RANDOM is a bash’s random number from 0 to 32767
period=$[ ($RANDOM % 20) + 15 ]
at -f /home/user1/at_run.sh now + $period minutes
————————————-
run /home/user1/at_run.sh and all next runs will be scheduled automatically, so your /the/command/you/need will run repeatedly forever. Sure, you can break the next run with atq/atrm.

Thx Rahul and Sergey.

@Sergey, in your last point you are basically using a wrapper with a random pause and re-scheduling of the at job.

I think this is also achievable with cron, without the “various checks preventing next run to start before previous is finished”.
You can just replace the last line of your script with this:

sleep $(($period * 60)) && exec /home/user1/at_run.sh

Then set a crontab for /home/user1/at_run.sh .
Note: the ‘exec’ bash builtin will prevent calling bash recursively (nested bash’s) and spare memory.
You will need to kill the process to end it.

If the job is not supposed to stay permanently (boot safe), I would prefer to use an interactive bash inside a ‘screen’ command and just do a loop:

while : ; do
/the/command/you/need
sleep 60
done

So you can follow in “live” the output of the script.

hello!
i am running centos. when i submit an at nothing happens. i can call it up using “atq #”, however, it doesn’t execute?
thanks for the help.

What are the differences between at-command and chrontab?

at command is used for one-time task scheduling. crontab is used for repeated tasks.

I need to run a script at particular time-stamp which internally calls one more script.
But I am getting an error :

at `./radConnect.sh` 09:00
sh: netstat: command not found
sh: /sbin/ifconfig: No such file or directory
Radskman rc:[0] [Request successfully completed]
syntax error. Last token seen: h
Garbled time

Schedule job like following

Hi Rahul,
Thanks for the quick response, the use case which I am trying is a bit different.
I have created some containers using a script and a script internally calls another one which needs to run at a particular timestamp. So the command prompt for giving the script won’t be visible. So is there any alternative to it. Or can we do it using crontab?

Try following command.

What would be the command for future date? midnight on 30 October 2017

echo “sh radConnect.sh” | at ?

i think it should be
echo “sh radConnect.sh” | at 0 0 30 10 * *

this would repeat every year on 30th October.

I think i’ve mixed up with crontab function command.

Correction of the previous command:
echo “sh radConnect.sh” | at 12:00 AM 30.10.17

Hi Nabil.. This will work

Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say fantastic blog!

We are interested as well as enthusiastic about what you really are writing about here.

Источник

I would like to test an at time argument before running the at command. The use case is that I would like to run the at command on a different computer at a different time, so I want to first store the at argument, which means I want to check it when it is first entered.

Example is before:

$ atarg1="now+7mintes"
# I would like to check the above *before* running this
$ at $atarg1 <<< "echo hi there"
syntax error. Last token seen: t
Garbled time

hlovdal's user avatar

hlovdal

25.6k10 gold badges93 silver badges162 bronze badges

asked May 11, 2016 at 5:17

Xu Wang's user avatar

You could always remove the job from the queue if it succeeds. This obviously has a race condition — in the unlikely event that the command executes from the queue between submitting and removing it, you will run a command needlessly. Running true when you didn’t want to has very low impact, though.

if success=$(at "$atarg" <<<true); then
    sed 's/^job ([1-9][0-9]*) at .*/1/' <<<"$success" | xargs atrm
    exit 0
else
    exit $?
fi

answered May 11, 2016 at 5:50

tripleee's user avatar

tripleeetripleee

170k31 gold badges261 silver badges306 bronze badges

You could try testing the time on GNU date. Note that this fails:

$ atarg="now+7mintes"
$ date -d "$atarg" >/dev/null 2>&1 || echo "Bad time"
Bad time

while this succeeds:

$ atarg="now+7minutes"
$ date -d "$atarg" >/dev/null 2>&1 || echo "Bad time"

In other words, when date -d is given a bad argument, date exits with a nonzero return code. This allows you to test under bash whether the date is good, at least as far as date accepting it.

I have not found any documentation to indicate that at and date use the same code to interpret dates. So, this approach has no guarantee.

Problem

It turns out that date is more flexible about its time format than at. As XuWang points out, date accepts 18minutes as shorthand for now + 18minutes but at does not:

$ date -d "18minutes"
Fri May 27 15:30:59 PDT 2016
$ echo true | at "18minutes"
syntax error. Last token seen: minutes
Garbled time

answered May 11, 2016 at 5:45

John1024's user avatar

John1024John1024

108k14 gold badges131 silver badges166 bronze badges

2

I have the following script that will schedule a job based on input from the file «schedule.csv». The file contains 7 fields and the $f7 field contains a flag that either has «NOT_S» for a job that needs to be scheduled and «YES» if the job has already been scheduled.

#!/bin/bash
filename='/home/opc/3A-Lab/schedule.csv'

i=1
while IFS=, read -r f1 f2 f3 f4 f5 f6 f7; do

        case "$f7" in

        NOT_S)
                test  $i -eq 1 && ((i=i+1)) && continue
                echo "/home/opc/3A-Lab/3ALab.sh $f5 start" | at  now
                echo "/home/opc/3A-Lab/3ALab.sh $f5 stop"  | at  now + "$f6" " " "hours"
                ;;
        YES)
                echo "Already Scheduled"
                ;;
esac
done < $filename

echo "something is wrong"

When I run the script, I get the output of «something is wrong» which is something I added a troubleshooting step to alert me that for some reason the logic I have is not working.

What I want is the jobs that have the flag «NOT_S» to be scheduled and the ones that have «YES» to be ignored. Without the decision logic, the jobs will get scheduled as desired. However, the problem with this is that I then have no way of excluding the jobs that have already be scheduled once the script runs again. The file it’s reading from is generated by a Google Form and I’m downloading the responses from Google Sheets via wget. I currently have Google Sheets setting the flag in column $f7 so that after a period of time, when the file is downloaded again and the script is run again on the server, it will only process the jobs that have been added to the sheet that have the «NOT_S» flag and ignore the other ones.

What am I doing wrong in my script as to why its not picking up on the value of $f7 and executing the commands to schedule the jobs? Thanks for any help you can provide.

EDIT:

Here is sample of what the schedule.csv file looks like:

Timestamp,Email Address,First Name,Last Name,Workstation Name,Duration (in hours),Schedule Flag
,,,,no workstation,,YES
1/1/2021 14:52:11,john.doe@domain.com,Jone Doe,no workstation,2,NOT_S
1/1/2021 15:39:48,jane.sue@domain.com,jane,sue,no workstation,2,NOT_S
1/1/2021 15:40:26,fred.flintstone,Fred,Flintsone,no workstation,5,YES
,,,,no workstation,,YES
,,,,no workstation,,
,,,,no workstation,,

So let me explain the file: A student comes to the Google form to book time for a virtual workstation. The form automatically retrieves their email address. Based on their email address, the sheet will populate with a workstation name associated with the student. Then the form asks them how much time do they want to reserve on the workstation. They can select between 1 to 5 hours from a drop down menu. Once that is complete, the form saves their entry onto the google sheet.

The sheet has a formula that will determine that uses the timestamp time +10 minutest to set the flag in field 7 to either NOT_S or YES. Once the 10 minutes are up, the flag gets set to YES. At the time of scheduling, it gets set to NOT_S.

Here is a sample output of the script scheduling the jobs without the conditional logic:

job 13984 at Sat Jan  2 14:41:00 2021
syntax error. Last token seen: hours
Garbled time
job 13985 at Sat Jan  2 14:41:00 2021
job 13986 at Sat Jan  2 16:41:00 2021
job 13987 at Sat Jan  2 14:41:00 2021
job 13988 at Sat Jan  2 16:41:00 2021
job 13989 at Sat Jan  2 14:41:00 2021
job 13990 at Sat Jan  2 19:41:00 2021
job 13991 at Sat Jan  2 14:41:00 2021
syntax error. Last token seen: hours
Garbled time
job 13992 at Sat Jan  2 14:41:00 2021
syntax error. Last token seen: hours
Garbled time
[opc@vm-control-server 3A-Lab]$ 

2nd EDIT:

Here is the output using the commands Gordon suggested:

[opc@vm-control-server 3A-Lab]$ file ./schedule.csv 
./schedule.csv: ASCII text, with CRLF line terminators
[opc@vm-control-server 3A-Lab]$ LC_ALL=C cat -vet ./schedule.csv 
Timestamp,Email Address,First Name,Last Name,Workstation Name,Duration (in hours),Schedule Flag^M$
,,,,no workstation,,YES^M$
1/1/2021 14:52:11,name@domain.com,Philip,Monroe,no workstation,2,NOT_S^M$
1/1/2021 15:39:48,name@domain.comi,John,Crocket,no workstation,2,NOT_S^M$
1/1/2021 15:40:26,name@domain.com,Eddie,Reed,no workstation,5,YES^M$
,,,,no workstation,,YES^M$
,,,,no workstation,,^M$
,,,,no workstation,,[opc@vm-control-server 3A-Lab]$ 

Edit 3:

Here is the updated file I’m running the script on:

[opc@vm-control-server 3A-Lab]$ LC_ALL=C cat -vet ./schedule.csv 
Timestamp,Email Address,First Name,Last Name,Workstation Name,Duration (in hours),Schedule Flag^M$
,,,,no workstation,,YES^M$
1/1/2021 14:52:11,name@domain.com,Philip,Monroe,no workstation,2,NOT_S^M$
1/1/2021 15:39:48,name@domain.com,John,Crocket,no workstation,2,NOT_S^M$
1/1/2021 15:40:26,name@domain.com,Fred,Brown,no workstation,5,YES^M$
,,,,no workstation,,YES^M$
,,,,no workstation,,^M$
,,,,no workstation,,[opc@vm-control-server 3A-Lab]$ 

Output of the script. Keep in mind, this running without any decision logic, so it’s not taking into account f7 field so it’s scheduling all jobs on the sheet.

[opc@vm-control-server 3A-Lab]$ ./final2.sh
job 13993 at Sat Jan  2 15:38:00 2021
syntax error. Last token seen: hours
Garbled time
job 13994 at Sat Jan  2 15:38:00 2021
job 13995 at Sat Jan  2 17:38:00 2021
job 13996 at Sat Jan  2 15:38:00 2021
job 13997 at Sat Jan  2 17:38:00 2021
job 13998 at Sat Jan  2 15:38:00 2021
job 13999 at Sat Jan  2 20:38:00 2021
job 14000 at Sat Jan  2 15:38:00 2021
syntax error. Last token seen: hours
Garbled time
job 14001 at Sat Jan  2 15:38:00 2021
syntax error. Last token seen: hours
Garbled time
[opc@vm-control-server 3A-Lab]$ 

Edit 4:

Olivier’s modifications are working great. However, I need to solve another problem that I hope you all can help me with. So the google sheet that I’m collecting the responses from the google form has a formula on it that checks the timestamp of the requested entry + 10 minutes to see if its >= to the now() time and if so, it changes the flag to YES. Well it works great on the form and ther flag gets changed, however, when my cron job pulls the next wget of the file, it doesn’t recognize the changes to the f7 field and still has the entry as NOT_S so my script will continue to schedule jobs that have already been scheduled.

What I ultimately want to do is as soon as the job is scheduled, immediately set the flag to YES so that once the file gets read again, it will get ignored.

I was trying to figure out how to use wget to only pull in the changes to the sheets file and not have to download the whole thing each time. I want to set up something where I can write out to a local file on the Linux server and just have the script update that local file with the flag change and only take in the new entries from the google sheet. I would appreciate some help with this. Thanks.

Понравилась статья? Поделить с друзьями:
  • Syntax error json parse error
  • Syntax error invalid syntax перевод
  • Syntax error unexpected token laravel
  • Syntax error invalid syntax string
  • Syntax error unexpected token joomla