Tuesday, July 02, 2019

mounting a windows smb share and automating file moves

mounted //PATH/FOLDER on a linux machine onto a folder /path/to/mountdir using

sudo mount -t cifs //192.168.ip.address/FOLDER path/to/mountdir -o uid=usernameofowner,username=username,password=xxxxx

A cron job was added to automatically move files every 5 minutes, like
*/5 * * * * mv /path/to/mountdir/LIVE_*  /path/to/another/dir/

But that caused problems, generating hundreds of emails to usernameofowner, saying mv: cannot stat ‘/path/to/mountdir/LIVE_*’: No such file or directory whenever there was no file there to move. So, PB modified the cron by adding
> /dev/null 2>&1 
which seems to have solved the issue, working well.

No comments:

Post a Comment