I am currently recording / updating my tables in the bank with the R language:
dbWriteTable (with," table ", table, row.names = FALSE, overwrite = TRUE)
This script of mine that updates the tables in R in a postgres database, is automatically run from time to time by a windows task.
I need to know when the information is recorded or not, perhaps in an alert format on the screen, or something that catches the eye.
note: I know that there is "r.out", but it overwrites, does not warn when the problem occurs, or anything like that.
You could call Windows Powershell:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
system:showMessage <- function(message) {
MessageScript <-'
[CmdletBinding()]
$ErrorActionPreference = "Stop"
$notificationTitle = "{message}"
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
#Convert back to WinRT type
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($toastXml.OuterXml)
$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
$toast.Tag = "PowerShell"
$toast.Group = "PowerShell"
$toast.ExpirationTime = [DateTimeOffset]::Now.AddMinutes(5)
#$toast.SuppressPopup = $true
$notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("PowerShell")
$notifier.Show($toast);'
system('powershell',input=glue::glue(MessageScript),show.output.on.console=F)
}
showMessage(message = 'this is a test')
This works for me:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With