The tag has no wiki summary.

learn more… | top users | synonyms

10
votes
1answer
152 views

Moving a file to a file that is being read

When a file is moved and the destination file already exists and is currently being read, will the operation succeed? Will it depend on how long the reading operation on the destination file lasts?
8
votes
1answer
221 views

Is `rm -rf` not atomic?

I've just caught a confusing error: rm: cannot remove `xxx/app/cache/prod': Directory not empty which was caused by the following command: rm -rf $cache_dir/* where $cache_dir is defined as ...
7
votes
3answers
2k views

How to launch a set of program inside tmux or gnome-terminal within a script?

I wanted to launch a few commands simultaneously in tmux or gnome-terminal or xfterminal , every different tab with a single command running , and close that tab when that command finishes. Any ...
6
votes
3answers
862 views

tee + cat: use an output several times and then concatenate results

If I call some command, for instance an echo I can use the results from that command in several other commands with tee. Example: echo "Hello world!" | tee >(command1) >(command2) ...
6
votes
4answers
2k views

using parallel to process unique input files to unique output files

I have a shell scripting problem where I'm given a directory full of input files (each file containing many input lines), and I need to process them individually, redirecting each of their outputs to ...
5
votes
1answer
408 views

cannot create regular file 'filename': File exists

I've been getting this strange error message in one of my build scripts - cp fails, returning the error "File exists". I've even tried using cp -f, which should overwrite the file if it exists, but ...
4
votes
2answers
606 views

rm -rf failing if deleting in parallel

rm -rf will fail if something tries to delete the same file tree (I think because rm enumerates the files first, then deletes). A simple test: # Terminal 1 for i in `seq 1 1000`; do mkdir -p ...
3
votes
2answers
678 views

Can there be multiple kernels executing at the same time?

I know that Linux OS's are typically multi-programmed, which means that multiple processes can be active at the same time. Can there be multiple kernels executing at the same time?
3
votes
1answer
58 views

How can the order of execution in the shell as it relates to redirection be upset about 1 time out of a 1000 on my system? [duplicate]

Considering this Q&A about the order of execution in the shell as it relates to redirection, and despite the fact that if a file doesn't exist it gets created first so that cat example.txt | shuf ...
3
votes
1answer
61 views

Edge cases in filesystem operations during backup and file copy

I have a question about file access in Linux that I cannot sum it up completely. Consider that I have a home directory that I backup it using rsync triggered via cron. My home directory is on an EXT4 ...
2
votes
1answer
285 views

What's the use dirsync option for mount?

Today I stumbled upon this mount's option: dirsync All directory updates within the filesystem should be done synchronously. This affects the following system calls: creat, link, unlink, ...
2
votes
2answers
32 views

Does time window still exist when the signal is not blocked

Many books say that a time window exists between the generation and delivery of the signal when the signal is not blocked. So I wonder whether the time window still exists when the signal is not ...
1
vote
1answer
24 views

Scanning a file by multiply antiviruses

I start needing to scan for viruses all files uploaded to my website. I've implemented a pretty simple prototype which I tested locally and it seemed work well. However, I need to make it more complex ...
1
vote
1answer
66 views

2 or more programs in same USB serial converter

Having a network of lets say 10 devices in RS-485, connected to the linux PC with a RS-485 to USB Converter. Already there is a C program interacting with the serial converter at /dev/ttyUSB0. My ...
1
vote
1answer
871 views

Capture user input while doing other things

Is there a way to have the output of a subprocess (something other than 'sleep' below) be dovetailed with the output from a foreground command-loop? For example: while true do echo "updating ...
1
vote
1answer
3k views

How do you make a cross-process locking in Linux (C/C++)?

I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates ...
1
vote
1answer
92 views

Will files created under source directory after running `cp` be copied?

Suppose I use cp to copy a directory to another place. If the process takes long, and I create a new file under the source directory, will it be copied, or does it depend on something?
1
vote
0answers
608 views

“No PostgreSQL user name specified” - possible concurrency issues?

For my dissertation I'm running the same cronjob on around 300 machines, which is: 10,25,40,55 * * * * /path/to/db_script.sh 1>/dev/null This script gets some values from the system (whether ...