In it's simplest realization, one can implement NGINX log rotation as following:
mv access.log access.log.0
kill -USR1 `cat master.nginx.pid`
My question. Do we have a concurrency issue here? I mean, if NGINX writes a log entry between two actions…
I ran (stupidly) these commands:
mv ncdu/ /home/*
mv ncdu/ /var/*
Trying to move the ncdu folder into these directories. And it caused me to remove all my Apache directories in my /home/ folder, except virtfs (cPanel).
As you can imagine, It's…
I am trying to automate a remote backup on our centOS server, I run the current command :
nice -n 10 mv -vfb /media/localbackup/* /media/remotebackup/
however when this is ran I get the following error and no files are moved
mv: inter-device move…
I'd like to move all sub-folders starting with a given suffix (Blah_ in the example) into an other directory using a linux bash script. Here's what the script looks like:
srcDir="/home/me/"
archiveDir="/Archive/"
prefix="Blah_"
mv -v -f…
Following is the scenario. There are multiple files in a directory created by users belonging to same unix group.
Unix Group: Prod.
User in Prod Unix Group: User1 User2 User3.
All 3 users have same privileges.
Scenario 1
If user3 wants to become…
If I rename a file with mv command like:
mv original_file_name new_file_name
Is this possible to recover the original filename on Linux Ext4 file system and if so how that can be done?
How can I move subfolders with a pattern to the new location?
Example list of sources:
/data/aaa/_old/
/data/bbb/_old/
The destinations should be:
/archive/aaa/_old/
/archive/bbb/_old/
Is there a way to do this with a regular expression and…
I have some kind of a kiosk Ubuntu set up based on Ubuntu Server 14.0.2 which runs an application on chrome. The kiosk has no internet connection thus the updates to the application should be done manually. I want the update process to be as easy as…
I have a directory containing three files, for example, 5.war, 6.war and 7.war.
What command will return the file with the "smallest" filename from this directory? (In this case, 5.war.)
I'm running a Bash script under Cygwin, but this question applies more broadly.
I have a remote file: //someremoteserver/somefile.db
That "//" path is under Cygwin--it's essentially a UNC pathname on a Windows network (in this case), so call it…
I am receiving an error when trying to mv some files that really doesn't make sense. I receive this error:
mv: cannot move `thatDir' to a subdirectory of itself, `/usr/local/apache-tomcat-6.0.32/webapps/thatDir'
When running the following command…
Everyday new audio files are created in dir1.
Sometime I move (mv) some files from dir1 to dir2
I want to delete all the files in dir2 that was moved before 20th June
Is this possible?