Skip to main content

Posts

Showing posts from August, 2017

Access denied renaming shared folder

If you are working in a shared active directory environment and has a shared folder that needs to be renamed once in a while.
But every time you want to rename there is always a user who is using the folder and therefore, renaming the folder is denied.
How to rename the folder when the shared folder is always in use?
Automation will come for the rescue in such a scenario.
How to automate renaming the folder?
Task scheduler and a simple batch file can do the task and a life saver.
Here's how to do it:
Of course, disconnect all the open files. Users should shutdown their computers when they went out of the office,
If they don't shutdown, force their disconnection by using the command below:
openfiles /disconnect /o read/write openfiles /disconnect /o no access
Then, rename the folder with the ren or rename command of course.
Syntax is the good old fashioned source folder or path and the new folder name.
If the batch file will be run directly on the server, then the drive letter w…

Use tar command to backup in Linux

tar or tape archive is a basic tool that every Linux user should know.

Its syntax is quite different from the traditional copy or move command.

Since tar works from a 'current working directory' perspective.

Traditional syntax for copy or move is source then the destination.

In tar, the syntax is the filename or the path where the backup will be save and the source or the folder to be backed up or archived.

Typing: man tar (at the terminal shows the following)

tar -cf archive.tar foo bar
# Create archive.tar from files foo and bar.

Basically, it's like the destination where the file will be saved and the source or the files that will be archived.

Here's a simple bash script that will append the time and date the tar file was executed to the filename of the tar file.

If the bash script is automated via cron, the filename of the tar file will include the date and time the cron executes the script.


#script begins

#!/bin/bash
NOW=$(date +%Y%m%d%H%M)
echo $NOW
tar -Pczvf   /mnt/o…