I have a script that uploaded a compressed file to an ftp, it is the code that I show below. This code works correctly, but I would like to adapt it so that once the file is uploaded, it deletes ftp files older than a week. Answer You can try this solution: Note: I have commented the Remove file line,
different ways to ignore a signal?
Im’ new to Linux and signal handling. the signal function prototype is below is my questions: Q1-if I want to ignore SIGINT signal, then I just need to simply code as: signal(SIGINT, SIG_IGN);, is my understanding corrct? Q2-What if I code as: since my own sigint_handler does nothing, it is pretty much …
Why does read block on a pipe until the write end is closed?
I’m trying to bolster my understanding of things related to fork, exec, dup, and redirecting stdin/stdout/stderr by writing the following popen-type function: Compilation and execution: My question is about the read() – I don’t quite grok why does the read() is seemingly block until the chil…
Ubuntu Command ‘pip’ not found, but there are 18 similar ones [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 2 y…
How to add characters in word and replace it using sed command in linux
I have one requirement. I have one text file named as a.txt, which is having list of words – Now I have one another file named as b.txt , which is having content as Like this n of lines are there with different different words. Then I am writing script file – So after running script the output fil…
Can someone help me understand how to use pyModbus to encode string data to a digital display board?
Using: python3, pyModbusTCP, Linux, Raspberry pi 4, ViewMarq by Automation Direct I have a digital display board that can receive ModBusTCP ascii packets. The information below is similar to what I am trying to send as a test message. <ID 30><CLR><WIN 0 0 287 31><POS 0 0><LJ><…
Cx Oracle ‘TNS could not resolve the connect identifier’
I am connecting to an Oracle DB using LDAP and the Python cx_Oracle library. I have proper sqlnet.ora, ldap.ora and tnsnames.ora files. On my Windows machine everything works fine using the 12.1 Oracle client and the following Python code: I have installed the Oracle instant client 12.1 on my Linux machine (D…
How to redirect specific exit code into a file in bash [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I currendtly have two if statements, each with a different exit code. How can I store these …
Ruby: how to access group info from /var/db/group.db
RHEL/CentOS 8.x, Ruby 2.5.5, irb 0.9.6 We have a specialized set up that keeps user and group information in /usr/local/etc/[user|group] and a custom Makefile to add that information to /var/db/[group|passwd].db accordingly. I am trying to get the list of groups a user belongs to, in Ruby, after login. I̵…
Adacore GNATCOLL Postgres library not installing on CentOS 8
I posted a question a couple of days ago regarding installing the GNATCOLL library on CentOS 8, which was kindly answered. I have now attempted to install the gnatcoll postgres library, which I was hoping would be the same process. However, when I attempt this, I receive the following error: Any help as to wh…