Goodnight,
Currently I have some processes scheduled in the windows scheduler by bat.
I would like to improve my process and I thought of 2 ways:
A -> in the execution of the code if you find an error, run some command to send an alert email.
B -> It would be possible to read a .rout file if it finds an error send an email informing that the processing failed.
Has anyone tried any of these ways?
Related
i have this command:
#bot.tree.command(name="restart", description="Restart the bot")
#app_commands.check(is_owner)
async def restart(interaction: discord.Interaction):
await interaction.response.defer()
os.execl(sys.executable, sys.executable, *sys.argv)
and, as you can see, it restarts the program.
but what I want it to also do, is when it does restart, send a followup message editing the defered message telling the user (me) that the bot has restarted.
Edit:
I have an on_ready event registered that I could do this in, but I don't know exactly how to do it.
I tried looking at interactions.py but couldn't find the send function that is said to be tied to it in the docs.
I am running a long R script. Is there a way to give me an overview of all the errors that occured after the script has run. (e.g. a function that I could enter after the script has finished running and that extracts me the error notifications from the console)
I have a DAG defined that contains a number of tasks, the last of which is only run if any of the previous tasks fail. This task simply posts to a Slack channel that the DAG run experienced errors.
What I would really like is if the message sent to the Slack channel contained the actual error that is logged in the task logs, to provide immediate context to the error and perhaps save Ops from having to dig through the logs.
Is this at all possible?
I am trying to debug my deployR script which gives a generic error "HTTP 400 Error" / "Bad Request" at the Web application end when it fails.
Is there a way to get DeployR to pass a more informative error to the web application. i.e. Typically whatever error message the underlying R program has thrown at Deployr?
If I do a local execution then DeployR does log these messages to the Console pane. But if the script is called Remotely where does it log these errors? Even if I have a deployr Session open simultaneously the Console does not seem to show anything.
Any ideas or Workarounds?
There is an API to retrieve console output. See https://deployr.revolutionanalytics.com/documents/dev/api-doc/guide/workingprojects.html#projectexecuteconsole
I have a requirement to transfer files from one server to another. I used RCP command to perform the same and it was working fine. Please find code below:
rcp tst.txt usrname#hostname:/home/username/destination_folder
I tried to automate the same using Expect command so created the below mentioned shell script:
#!/bin/bash
/usr/bin/expect -d<<EOD
spawn rcp tst.txt usrname#hostname:/home/username/destination_folder
expect "*userid#hostname's password:*"
send "mypassword\n"
EOD
I didn't get any error while I executing the shell script but the file was not transferred. Can someone help me figuring out what the issue is?
I have tried password less transfer through key generation but with no luck so I am trying the RCP approach.
Thanks in Advance,
Vijay
After sending the password, wait for the completion of rcp, by expecting for eof.
send "mypassword\r"
expect eof
If password-less, then, after spawning rcp, expect for eof.